2024-06-19 09:58:22 +00:00
.. image :: https://github.com/element-hq/product/assets/87339233/7abf477a-5277-47f3-be44-ea44917d8ed7
:height: 60px
2024-06-25 15:20:59 +00:00
**Element Synapse - Matrix homeserver implementation**
|support| |development| |documentation| |license| |pypi| |python|
2024-06-19 09:58:22 +00:00
2024-06-26 16:01:39 +00:00
Synapse is an open source `Matrix <https://matrix.org> `__ homeserver
2024-06-19 09:58:22 +00:00
implementation, written and maintained by `Element <https://element.io> `_ .
2024-06-26 16:01:39 +00:00
`Matrix <https://github.com/matrix-org> `__ is the open standard for
2024-06-19 09:58:22 +00:00
secure and interoperable real time communications. You can directly run
and manage the source code in this repository, available under an AGPL
license. There is no support provided from Element unless you have a
subscription.
Subscription alternative
2024-06-25 15:20:59 +00:00
========================
2024-06-19 09:58:22 +00:00
Alternatively, for those that need an enterprise-ready solution, Element
Server Suite (ESS) is `available as a subscription <https://element.io/pricing> `_ .
ESS builds on Synapse to offer a complete Matrix-based backend including the full
`Admin Console product <https://element.io/enterprise-functionality/admin-console> `_ ,
giving admins the power to easily manage an organization-wide
deployment. It includes advanced identity management, auditing,
moderation and data retention options as well as Long Term Support and
SLAs. ESS can be used to support any Matrix-based frontend client.
2022-08-17 15:46:09 +00:00
2015-03-14 00:22:41 +00:00
.. contents ::
2024-06-19 09:58:22 +00:00
🛠️ Installing and configuration
===============================
2014-08-12 18:36:36 +00:00
2023-12-13 16:15:22 +00:00
The Synapse documentation describes `how to install Synapse <https://element-hq.github.io/synapse/latest/setup/installation.html> `_ . We recommend using
`Docker images <https://element-hq.github.io/synapse/latest/setup/installation.html#docker-images-and-ansible-playbooks> `_ or `Debian packages from Matrix.org
<https://element-hq.github.io/synapse/latest/setup/installation.html#matrixorg-packages> `_.
2014-08-13 14:23:06 +00:00
2022-08-17 15:46:09 +00:00
.. _federation:
2014-10-02 10:00:21 +00:00
2022-08-17 15:46:09 +00:00
Synapse has a variety of `config options
2023-12-13 16:15:22 +00:00
<https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html> `_
2022-08-17 15:46:09 +00:00
which can be used to customise its behaviour after installation.
There are additional details on how to `configure Synapse for federation here
2023-12-13 16:15:22 +00:00
<https://element-hq.github.io/synapse/latest/federate.html> `_.
2014-08-13 14:37:57 +00:00
2022-08-17 15:46:09 +00:00
.. _reverse-proxy:
2014-08-13 14:37:57 +00:00
2022-08-17 15:46:09 +00:00
Using a reverse proxy with Synapse
----------------------------------
2014-08-13 14:23:06 +00:00
2022-08-17 15:46:09 +00:00
It is recommended to put a reverse proxy such as
`nginx <https://nginx.org/en/docs/http/ngx_http_proxy_module.html> `_ ,
`Apache <https://httpd.apache.org/docs/current/mod/mod_proxy_http.html> `_ ,
`Caddy <https://caddyserver.com/docs/quick-starts/reverse-proxy> `_ ,
`HAProxy <https://www.haproxy.org/> `_ or
`relayd <https://man.openbsd.org/relayd.8> `_ in front of Synapse. One advantage of
doing so is that it means that you can expose the default https port (443) to
Matrix clients without needing to run Synapse with root privileges.
For information on configuring one, see `the reverse proxy docs
2023-12-13 16:15:22 +00:00
<https://element-hq.github.io/synapse/latest/reverse_proxy.html> `_.
2014-08-22 23:50:49 +00:00
2022-08-17 15:46:09 +00:00
Upgrading an existing Synapse
-----------------------------
2014-10-02 10:00:21 +00:00
2022-08-17 15:46:09 +00:00
The instructions for upgrading Synapse are in `the upgrade notes`_ .
Please check these instructions as upgrading may require extra steps for some
versions of Synapse.
2014-08-12 18:36:36 +00:00
2023-12-13 16:15:22 +00:00
.. _the upgrade notes: https://element-hq.github.io/synapse/develop/upgrade.html
2014-08-12 18:36:36 +00:00
2022-08-17 15:46:09 +00:00
Platform dependencies
---------------------
2014-08-12 18:36:36 +00:00
2022-08-17 15:46:09 +00:00
Synapse uses a number of platform dependencies such as Python and PostgreSQL,
and aims to follow supported upstream versions. See the
2023-12-13 16:15:22 +00:00
`deprecation policy <https://element-hq.github.io/synapse/latest/deprecation_policy.html> `_
2022-08-17 15:46:09 +00:00
for more details.
2014-08-12 18:36:36 +00:00
2022-08-17 15:46:09 +00:00
Security note
-------------
2014-08-13 10:48:55 +00:00
2022-08-17 15:46:09 +00:00
Matrix serves raw, user-supplied data in some APIs -- specifically the `content
repository endpoints`_.
2014-11-17 19:42:27 +00:00
2022-08-17 15:46:09 +00:00
.. _content repository endpoints: https://matrix.org/docs/spec/client_server/latest.html#get-matrix-media-r0-download-servername-mediaid
2020-05-01 15:27:22 +00:00
2022-08-17 15:46:09 +00:00
Whilst we make a reasonable effort to mitigate against XSS attacks (for
instance, by using `CSP`_ ), a Matrix homeserver should not be hosted on a
domain hosting other web applications. This especially applies to sharing
the domain with Matrix web clients and other sensitive applications like
webmail. See
https://developer.github.com/changes/2014-04-25-user-content-security for more
information.
2020-05-01 15:27:22 +00:00
2022-08-17 15:46:09 +00:00
.. _CSP: https://github.com/matrix-org/synapse/pull/1021
2021-08-31 10:29:27 +00:00
2022-08-17 15:46:09 +00:00
Ideally, the homeserver should not simply be on a different subdomain, but on
a completely different `registered domain`_ (also known as top-level site or
eTLD+1). This is because `some attacks`_ are still possible as long as the two
applications share the same registered domain.
2020-05-01 15:27:22 +00:00
2022-08-17 15:46:09 +00:00
.. _registered domain: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-2.3
2020-05-01 15:27:22 +00:00
2022-08-17 15:46:09 +00:00
.. _some attacks: https://en.wikipedia.org/wiki/Session_fixation#Attacks_using_cross-subdomain_cookie
2015-04-28 23:00:24 +00:00
2022-08-17 15:46:09 +00:00
To illustrate this with an example, if your Element Web or other sensitive web
application is hosted on `` A.example1.com `` , you should ideally host Synapse on
`` example2.com `` . Some amount of protection is offered by hosting on
`` B.example1.com `` instead, so this is also acceptable in some scenarios.
However, you should *not* host your Synapse on `` A.example1.com `` .
Note that all of the above refers exclusively to the domain used in Synapse's
`` public_baseurl `` setting. In particular, it has no bearing on the domain
mentioned in MXIDs hosted on that server.
2019-03-12 14:23:28 +00:00
2022-08-17 15:46:09 +00:00
Following this advice ensures that even if an XSS is found in Synapse, the
impact to other applications will be minimal.
2014-08-12 14:10:52 +00:00
2015-12-01 23:05:03 +00:00
2024-06-19 09:58:22 +00:00
🧪 Testing a new installation
2024-06-26 16:01:39 +00:00
=============================
2016-12-02 10:33:50 +00:00
2016-12-02 11:18:31 +00:00
The easiest way to try out your new Synapse installation is by connecting to it
2019-02-12 10:53:28 +00:00
from a web client.
Unless you are running a test instance of Synapse on your local machine, in
general, you will need to enable TLS support before you can successfully
2021-07-08 14:46:13 +00:00
connect from a client: see
2023-12-13 16:15:22 +00:00
`TLS certificates <https://element-hq.github.io/synapse/latest/setup/installation.html#tls-certificates> `_ .
2019-02-12 10:53:28 +00:00
2020-07-29 14:35:44 +00:00
An easy way to get started is to login or register via Element at
https://app.element.io/#/login or https://app.element.io/#/register respectively.
2019-02-12 10:53:28 +00:00
You will need to change the server you are logging into from `` matrix.org ``
2019-03-12 14:23:28 +00:00
and instead specify a Homeserver URL of `` https://<server_name>:8448 ``
(or just `` https://<server_name> `` if you are using a reverse proxy).
If you prefer to use another client, refer to our
2023-10-30 16:05:34 +00:00
`client breakdown <https://matrix.org/ecosystem/clients/> `_ .
2017-09-25 14:20:23 +00:00
2016-12-02 11:18:31 +00:00
If all goes well you should at least be able to log in, create a room, and
start sending messages.
2016-12-02 10:33:50 +00:00
2016-12-02 11:18:56 +00:00
.. _`client-user-reg`:
2016-12-02 11:18:31 +00:00
Registering a new user from a client
------------------------------------
2016-12-02 10:33:50 +00:00
2016-12-02 11:18:56 +00:00
By default, registration of new users via Matrix clients is disabled. To enable
2022-08-17 15:46:09 +00:00
it:
1. In the
2023-12-13 16:15:22 +00:00
`registration config section <https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html#registration> `_
2022-08-17 15:46:09 +00:00
set `` enable_registration: true `` in `` homeserver.yaml `` .
2. Then **either** :
2016-12-02 11:18:56 +00:00
2023-12-13 16:15:22 +00:00
a. set up a `CAPTCHA <https://element-hq.github.io/synapse/latest/CAPTCHA_SETUP.html> `_ , or
2022-08-17 15:46:09 +00:00
b. set `` enable_registration_without_verification: true `` in `` homeserver.yaml `` .
We **strongly** recommend using a CAPTCHA, particularly if your homeserver is exposed to
the public internet. Without it, anyone can freely register accounts on your homeserver.
This can be exploited by attackers to create spambots targetting the rest of the Matrix
federation.
2016-12-02 11:18:56 +00:00
2019-03-04 15:59:43 +00:00
Your new user name will be formed partly from the `` server_name `` , and partly
from a localpart you specify when you create the account. Your name will take
the form of::
2016-12-02 10:33:50 +00:00
2016-12-02 17:11:58 +00:00
@localpart:my.domain.name
2016-12-02 10:33:50 +00:00
2016-12-02 17:11:58 +00:00
(pronounced "at localpart on my dot domain dot name").
2016-12-02 10:33:50 +00:00
2016-12-02 11:18:31 +00:00
As when logging in, you will need to specify a "Custom server". Specify your
desired `` localpart `` in the 'User name' box.
2016-12-02 10:33:50 +00:00
2024-06-19 09:58:22 +00:00
🎯 Troubleshooting and support
2024-06-26 16:01:39 +00:00
==============================
2024-06-19 09:58:22 +00:00
🚀 Professional support
2024-06-26 16:01:39 +00:00
-----------------------
2024-06-19 09:58:22 +00:00
Enterprise quality support for Synapse including SLAs is available as part of an
`Element Server Suite (ESS) <https://element.io/pricing>` subscription.
If you are an existing ESS subscriber then you can raise a `support request <https://ems.element.io/support>`
and access the `knowledge base <https://ems-docs.element.io>` .
🤝 Community support
2024-06-26 16:01:39 +00:00
--------------------
2016-08-26 23:20:13 +00:00
2023-12-13 16:15:22 +00:00
The `Admin FAQ <https://element-hq.github.io/synapse/latest/usage/administration/admin_faq.html> `_
2022-08-17 15:46:09 +00:00
includes tips on dealing with some common problems. For more details, see
2023-12-13 16:15:22 +00:00
`Synapse's wider documentation <https://element-hq.github.io/synapse/latest/> `_ .
2016-12-02 11:00:23 +00:00
2022-08-17 15:46:09 +00:00
For additional support installing or managing Synapse, please ask in the community
support room |room|_ (from a matrix.org account if necessary). We do not use GitHub
issues for support requests, only for bug reports and feature requests.
2021-05-27 11:41:16 +00:00
2022-08-17 15:46:09 +00:00
.. |room| replace :: `` #synapse:matrix.org ``
.. _room: https://matrix.to/#/#synapse:matrix.org
2016-12-02 11:02:08 +00:00
2022-08-17 15:46:09 +00:00
.. |docs| replace :: `` docs ``
.. _docs: docs
2016-12-02 11:02:08 +00:00
2024-06-19 09:58:22 +00:00
🪪 Identity Servers
2024-06-26 16:01:39 +00:00
===================
2014-08-12 14:10:52 +00:00
2016-12-02 10:42:10 +00:00
Identity servers have the job of mapping email addresses and other 3rd Party
IDs (3PIDs) to Matrix user IDs, as well as verifying the ownership of 3PIDs
before creating that mapping.
2016-12-02 17:11:58 +00:00
**They are not where accounts or credentials are stored - these live on home
servers. Identity Servers are just for mapping 3rd party IDs to matrix IDs.**
2016-12-02 10:42:10 +00:00
This process is very security-sensitive, as there is obvious risk of spam if it
is too easy to sign up for Matrix accounts or harvest 3PID data. In the longer
term, we hope to create a decentralised system to manage it (`matrix-doc #712
<https://github.com/matrix-org/matrix-doc/issues/712> `_), but in the meantime,
the role of managing trusted identity in the Matrix ecosystem is farmed out to
a cluster of known trusted ecosystem partners, who run 'Matrix Identity
Servers' such as `Sydent <https://github.com/matrix-org/sydent> `_ , whose role
is purely to authenticate and track 3PID logins and publish end-user public
keys.
You can host your own copy of Sydent, but this will prevent you reaching other
users in the Matrix ecosystem via their email address, and prevent them finding
you. We therefore recommend that you use one of the centralised identity servers
at `` https://matrix.org `` or `` https://vector.im `` for now.
To reiterate: the Identity server will only be used if you choose to associate
an email address with your account, or send an invite to another user via their
email address.
2014-08-13 02:01:27 +00:00
2016-04-08 17:54:18 +00:00
2024-06-19 09:58:22 +00:00
🛠️ Development
==============
2016-12-02 10:33:50 +00:00
2022-08-17 15:46:09 +00:00
We welcome contributions to Synapse from the community!
2021-08-31 10:29:27 +00:00
The best place to get started is our
2023-12-13 16:15:22 +00:00
`guide for contributors <https://element-hq.github.io/synapse/latest/development/contributing_guide.html> `_ .
This is part of our larger `documentation <https://element-hq.github.io/synapse/latest> `_ , which includes
2021-08-31 10:29:27 +00:00
2022-08-17 15:46:09 +00:00
information for Synapse developers as well as Synapse administrators.
2021-08-31 10:29:27 +00:00
Developers might be particularly interested in:
2023-12-13 16:15:22 +00:00
* `Synapse's database schema <https://element-hq.github.io/synapse/latest/development/database_schema.html> `_ ,
* `notes on Synapse's implementation details <https://element-hq.github.io/synapse/latest/development/internal_documentation/index.html> `_ , and
* `how we use git <https://element-hq.github.io/synapse/latest/development/git.html> `_ .
2021-08-31 10:29:27 +00:00
Alongside all that, join our developer community on Matrix:
`#synapse-dev:matrix.org <https://matrix.to/#/#synapse-dev:matrix.org> `_ , featuring real humans!
2024-06-19 09:58:22 +00:00
.. |support| image :: https://img.shields.io/badge/matrix-community%20support-success
:alt: (get community support in #synapse:matrix.org)
2020-10-08 10:16:56 +00:00
:target: https://matrix.to/#/#synapse:matrix.org
.. |development| image :: https://img.shields.io/matrix/synapse-dev:matrix.org?label=development&logo=matrix
:alt: (discuss development on #synapse-dev:matrix.org)
:target: https://matrix.to/#/#synapse-dev:matrix.org
2021-08-31 10:29:27 +00:00
.. |documentation| image :: https://img.shields.io/badge/documentation-%E2%9C%93-success
:alt: (Rendered documentation on GitHub Pages)
2023-12-13 16:15:22 +00:00
:target: https://element-hq.github.io/synapse/latest/
2021-08-31 10:29:27 +00:00
2023-12-13 15:41:11 +00:00
.. |license| image :: https://img.shields.io/github/license/element-hq/synapse
2020-10-08 10:16:56 +00:00
:alt: (check license in LICENSE file)
:target: LICENSE
.. |pypi| image :: https://img.shields.io/pypi/v/matrix-synapse
:alt: (latest version released on PyPi)
:target: https://pypi.org/project/matrix-synapse
.. |python| image :: https://img.shields.io/pypi/pyversions/matrix-synapse
:alt: (supported python versions)
:target: https://pypi.org/project/matrix-synapse