Synapse
A Matrix homeserver that manages users, rooms, federation, events, media, authentication, and client APIs.
Why consider Synapse?
Synapse is the reference Matrix homeserver implementation written in Python and Rust for decentralized chat. It provides federated real-time messaging, end-to-end encryption support, and self-hosted communication infrastructure.
Learn Synapse by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide4 sections
Overview and Architecture
Synapse serves as the reference open source Matrix homeserver implementation maintained by Element for decentralized communication. Operating as the foundational server implementation for the Matrix protocol, Synapse empowers teams to establish private, federated, and encrypted communication backbones with complete ownership over data storage and routing policies. Full overview documentation is available in https://raw.githubusercontent.com/element-hq/synapse/develop/README.rst and source development is hosted on https://github.com/element-hq/synapse.
The open source distribution of Synapse is licensed under the GNU Affero General Public License version 3 to ensure server software transparency. Under this copyleft license, self-hosted deployments and network service modifications remain accessible to the community, with complete license terms documented at https://raw.githubusercontent.com/element-hq/synapse/develop/LICENSE-AGPL-3.0.
Release version v1.159.0 ships active homeserver updates with complete changelog records in the element-hq repository. Upgrading production nodes promptly ensures environments benefit from ongoing performance optimizations and security patches published at https://github.com/element-hq/synapse/releases/tag/v1.159.0.
Server Identity and Virtualenv Installation
Before initializing your homeserver configuration, establishing an accurate domain name is mandatory. The server name permanently defines the domain portion of all user IDs and governs federation discoverability across the Matrix network. Because this value cannot be migrated after state creation, administrators should review the official naming guidance in https://raw.githubusercontent.com/element-hq/synapse/develop/docs/setup/installation.md.
Synapse relies on a POSIX-compliant Python runtime alongside PostgreSQL for robust production database storage. To prepare an isolated Python environment on Linux or macOS systems, execute the standard package installation commands from https://raw.githubusercontent.com/element-hq/synapse/develop/docs/setup/installation.md:
mkdir -p ~/synapsevirtualenv -p python3 ~/synapse/envsource ~/synapse/env/bin/activatepip install --upgrade pippip install --upgrade setuptoolspip install matrix-synapsePostgreSQL Database Configuration
PostgreSQL databases backing Synapse must be provisioned with UTF8 encoding and C locale to store federated event data correctly. Create the dedicated database user role and UTF8 database schema using the official instructions at https://raw.githubusercontent.com/element-hq/synapse/develop/docs/postgres.md:
# this will prompt for a password for the new usercreateuser --pwprompt synapse_usercreatedb --encoding=UTF8 --locale=C --template=template0 --owner=synapse_user synapseSynapse uses psycopg2 connection pooling parameters to manage concurrent database worker connections. Populate the database configuration section inside homeserver.yaml with the connection arguments specified in https://raw.githubusercontent.com/element-hq/synapse/develop/docs/postgres.md:
database: name: psycopg2 args: user: <user> password: <pass> dbname: <db> host: <host> cp_min: 5 cp_max: 10Reverse Proxy Setup
Deploying a reverse proxy exposes standard HTTPS port 443 to client applications without requiring Synapse processes to bind privileged ports or run as root. A fronting Nginx server routes client and federation traffic to internal listener port 8008 while terminating TLS certificates, matching the reference configuration from https://raw.githubusercontent.com/element-hq/synapse/develop/docs/reverse_proxy.md:
server { listen 443 ssl; listen [::]:443 ssl; # For the federation port listen 8448 ssl default_server; listen [::]:8448 ssl default_server; server_name matrix.example.com; location ~ ^(/_matrix|/_synapse/client) { # note: do not add a path (even a single /) after the port in `proxy_pass`, # otherwise nginx will canonicalise the URI and cause signature verification # errors. proxy_pass http://localhost:8008; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host:$server_port; # Nginx by default only allows file uploads up to 1M in size # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml client_max_body_size 50M; # Synapse responses may be chunked, which is an HTTP/1.1 feature. proxy_http_version 1.1; }}The official Synapse website redirects administrators and developers to the latest documentation portal. Operators can access comprehensive guides on room versioning, clustering workers, and operational administration at https://element-hq.github.io/synapse and browse source repositories via https://github.com/element-hq/synapse.
Related tools
More options with a similar category or technology profile.
MISP
Open source threat intelligence and cyber security information sharing platform.
Zulip Mobile
Official React Native mobile application for Zulip organized team chat.
Wire Server
End-to-end encrypted enterprise team communication, conferencing, and file sharing platform.
Signal Server
Enterprise-grade end-to-end encrypted messaging server infrastructure powering Signal.