Introduction
Synapse is the reference homeserver for the Matrix open communication protocol. Matrix provides decentralized, end-to-end encrypted messaging where each organization runs its own server while federating with others. Synapse handles user accounts, room state, message history, and federation, serving as the backbone for clients like Element. It is maintained by Element HQ under the AGPL-3.0 license.
What Synapse Does
- Hosts Matrix chat rooms with persistent message history and state
- Federates with other Matrix homeservers for cross-organization communication
- Provides end-to-end encryption via the Olm and Megolm protocols
- Supports voice and video calls through WebRTC signaling
- Manages user authentication, registration, and access control
Architecture Overview
Synapse is a Python/Twisted application backed by PostgreSQL for persistent storage and optionally Redis for worker coordination. It exposes the Matrix Client-Server API for clients and the Server-Server API for federation. In production, Synapse can scale horizontally by splitting workloads across multiple worker processes. A reverse proxy handles TLS termination and routes traffic to the appropriate endpoints.
Self-Hosting & Configuration
- Deploy with Docker or install from packages on Debian/Ubuntu
- Use PostgreSQL instead of the default SQLite for production workloads
- Configure federation by setting up DNS SRV records and port 8448
- Enable worker mode with Redis to scale for large deployments
- Set up TURN/STUN servers (e.g., coturn) for voice and video calls
Key Features
- Full federation support for communicating across independent servers
- End-to-end encryption with cross-signing and device verification
- Bridges to Slack, Discord, IRC, Telegram, and other platforms
- Spaces for organizing rooms into hierarchical structures
- Admin API for user management, room purging, and server diagnostics
Comparison with Similar Tools
- Mattermost — centralized team chat; no federation by default
- Rocket.Chat — self-hosted chat with limited federation support
- XMPP (Prosody/ejabberd) — older federated protocol; less rich media support
- Zulip — threaded team chat; no decentralized federation
FAQ
Q: How much resources does Synapse need? A: For a small server (under 100 users), 2 CPU cores, 2 GB RAM, and PostgreSQL is sufficient. Larger deployments benefit from worker processes.
Q: Can I bridge Matrix to other chat platforms? A: Yes. The Matrix ecosystem provides bridges for Slack, Discord, IRC, Telegram, WhatsApp, Signal, and more via projects like mautrix and matrix-appservice.
Q: Is federation mandatory? A: No. You can run a private homeserver with federation disabled for internal-only communication.
Q: How do I migrate from Slack or Discord to Matrix? A: Use the respective bridge to connect both platforms, then gradually move users. Message history can be backfilled using bridge-specific import tools.