Matrix federation is the technology that lets separate Matrix servers exchange messages, so users on different homeservers can chat in the same rooms as if they were on one platform. For community chat, this means you can run your own server, keep control of your data, and still talk to anyone else on the Matrix network—no central company required.
What Is Matrix Federation?
Matrix is an open-source, decentralized communication protocol. Instead of one central server (like Discord or Slack), anyone can run a homeserver—the Matrix term for a server. Federation is the process by which these homeservers talk to each other. When a user on server A sends a message to a room that also has members on server B, server A forwards the event to server B over the internet, using the Matrix server-server API. The receiving server then distributes the message to its local users.
This is similar to how email works: you can send a message from Gmail to Outlook because both use the same protocol (SMTP). Matrix does the same for real-time chat, but with additional features like end-to-end encryption and synced history.
Why Federation Matters for Communities
Federation changes the power dynamic. In a centralized chat app, the company that runs the service decides the rules, can read messages (unless encrypted), and can shut down or change features at any time. With a federated Matrix community:
- Ownership: You run your own homeserver, so you own the data and the infrastructure.
- Interoperability: Your members can chat with people on any other Matrix server—public rooms are visible across the network.
- Resilience: If one server goes down, the rest of the network keeps working. Your community isn’t dependent on a single company’s uptime.
- Privacy: You can choose to federate only with trusted servers, or not at all, giving you granular control.
For a community, this means you can have a private, self-managed space that still connects to the wider Matrix ecosystem. For example, a gaming guild might run a small server for its members, but still join public rooms on larger servers to recruit or coordinate with allies.
How Federation Works Under the Hood
When two servers federate, they exchange events—the building blocks of Matrix conversations. Each room is identified by a unique ID, and each server that hosts members of that room keeps a copy of the room’s state and event history. When a message is sent, the sending server signs it and pushes it to all other participating servers. The receiving servers validate the signature and update their local copy.
Key components:
- Homeserver: The server software (like Synapse or Dendrite) that stores accounts, rooms, and messages.
- Federation API: The set of endpoints that servers use to exchange events, join rooms, and fetch missing data.
- Server Keys: Cryptographic keys that prove a server’s identity, preventing impersonation.
- Room Aliases: Human-readable addresses like
#community:example.comthat resolve to the actual room ID.
When a user wants to join a room on another server, their homeserver first looks up the room via the alias, then requests to join. The remote server approves the request and begins sending the room’s history to the new server.
Choosing a Homeserver for Your Community
You have two main options: self-host or use a hosted provider. Self-hosting gives you full control but requires technical knowledge and maintenance. Hosted providers (like matrix.org or other public servers) are easier but mean you’re relying on someone else’s infrastructure.
When choosing, consider:
- Size: How many users? Small communities (under 50) can run on modest hardware; larger ones need more resources.
- Technical skill: Are you comfortable with Linux, Docker, and server administration? If not, a hosted provider is safer.
- Data sensitivity: If your community deals with sensitive topics, self-hosting with federation limited to trusted servers might be best.
- Uptime: A self-hosted server on a home internet connection may be unreliable. Consider a small VPS.
For most communities, starting on a public server is fine, then migrating to your own server when you outgrow it or want more control.
Common Problems and Misconceptions
Misconception: Federation means everyone can see your messages. Not true. Rooms can be private, and end-to-end encryption (E2EE) means even server admins can’t read messages if the room is encrypted. Federation only shares data with servers that have members in the room.
Problem: Slow federation. If your server has poor connectivity or is behind a strict firewall, message delivery can lag. The Matrix protocol uses a retry mechanism, but delays can happen.
Problem: Split brain. If two servers temporarily lose connection, they both continue to operate, and when they reconnect, they must merge state. This is usually seamless, but can occasionally cause brief inconsistencies.
Misconception: You must federate. You can run a Matrix server with federation disabled, making it a private, isolated network. This is useful for internal company chat or a family group.
Federation vs. Centralized Chat vs. Other Protocols
Compared to Discord or Slack, Matrix federation offers more privacy and control, but at the cost of convenience—you have to manage your own server and the user experience can be less polished. Compared to IRC, Matrix is modern: it supports E2EE, file sharing, and push notifications, while IRC is plaintext and basic. Compared to XMPP (another federated protocol), Matrix has better support for group chat and history sync.
Matrix’s main advantage is its state resolution algorithm, which ensures that even when servers disagree, they converge to a consistent state. This makes federation more robust than older protocols.
Costs and Practical Considerations
Self-hosting a Matrix server is free in terms of software, but you’ll pay for a VPS (around $5–$20 per month for a small community) and your time for maintenance. Hosted providers often have free tiers, but may have limits on storage or features.
You also need to consider:
- Storage: Media files (images, videos) can consume significant disk space. Plan for backups.
- Bandwidth: Federation uses bandwidth for every message sent to other servers. If you have a large community, this can add up.
- Legal compliance: If you self-host, you’re responsible for data protection (e.g., GDPR if you have EU users).
Frequently Asked Questions
Can I migrate my community from Discord to Matrix? Yes, but there’s no official one-click tool. You’ll need to export messages (if you have a bot) and recreate channels as rooms. The process is manual but doable.
Is Matrix federation secure? Yes, when configured correctly. Messages can be end-to-end encrypted, and server-to-server communication uses HTTPS with certificate verification. However, metadata (who talks to whom) is visible to server admins.
What happens if my server goes offline? Your users can’t access rooms hosted on your server, but they can still use other servers. If you’re away for a long time, the room history is preserved on other servers, so when you return, you’ll sync.
Can I block a specific server from federating with mine? Yes, you can use the server ACL (Access Control List) feature to deny or allow federation from specific servers. This is useful for blocking spam or abusive servers.
Do I need to run my own server to use Matrix? No, you can register on a public server like matrix.org. You’ll still be able to join federated rooms, but you won’t have your own domain or admin control.
How does Matrix compare to ActivityPub (Mastodon)? Both are federated, but they serve different purposes. Matrix is for real-time chat, while ActivityPub is for social media (posts, follows). They can’t directly interoperate, but bridges exist.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Google Assistant IFTTT Recipes: 7 Useful Automations
- OLED TVs in Dark Rooms: Why They Look Better and When They Don’t
- Philips DST7060/20 7000 Series Iron: Specs & Fit
- Coal Fueled Jet Aircraft: Could It Work?675 L
- Remote Desktop on Raspberry Pi: How to Enable It
- Word Select Last Line in Paragraph?