How to self-host Matrix and why you probably shouldn't
You have heard about Matrix. Federated chat, end-to-end encryption, you own your data. The promise is simple: run your own server, keep your conversations off someone else’s cloud. It is the same pitch as email was twenty years ago, and we all know how that turned out.
We run Matrix servers for a living. We wrote the most popular deployment playbook for it. We know exactly what self-hosting Matrix looks like from the inside, and we want to show you, because the gap between “I could run my own server” and “I am running my own server” is where most people get stuck.
This is what it actually costs you.
What you are signing up for¶
A basic Matrix server needs a few things:
- A VPS with at least 2 GB of RAM and 40 GB of disk
- Synapse (the homeserver), PostgreSQL, and a reverse proxy
- A domain name with DNS records pointed at your server
- SSL certificates (Let’s Encrypt handles this, but you need to wire it up)
- A TURN server (coturn) if you want legacy voice or video calls to work behind NAT
- An Ansible playbook or a docker-compose stack to tie it all together
If you are technically inclined and have a weekend, you can get this running. The matrix-docker-ansible-deploy playbook we maintain makes it about as painless as it gets.
The question is not whether you can set it up. It is what happens after.
The database will grow and grow and grow¶
Synapse uses an append-only table called state_groups_state to track room state. Append-only means it never shrinks. Deleting a room does not clean it up. Users cannot be deleted either. The API lets you deactivate them, but the account stays on the server forever. Even media attached to deleted messages stays on disk, because another message might reference it.
A server with fewer than ten active users can easily accumulate several gigabytes of database and media. The official recommendation is to set up message retention policies, run a separate media repository, and periodically vacuum the database. That is three things you need to configure, monitor, and maintain on top of the server itself.
One person on Hacker News described it this way: “I am just gonna bite the bullet, couple terabytes should not be a problem in 25 years.” That was about media they could not delete.
We handle this as part of our weekly maintenance cycle. Database vacuum, media cleanup, retention policy enforcement. It runs automatically, every week, without you thinking about it. You can see exactly what that looks like on our services page.
Voice and video calls require a second deployment¶
The old way to do calls in Matrix was a TURN server (coturn). It worked for one-on-one calls, barely, and only if you configured it right. Then Element introduced Matrix RTC with LiveKit, which enables group calls. The two systems are not interoperable. If you upgrade to Matrix RTC, old clients cannot call new clients, and nobody tells you this until you try.
Setting up LiveKit for Matrix requires: a LiveKit server, the lk-jwt-service for authentication, and the right reverse proxy configuration. One guide for this setup runs to several pages and assumes you already know the stack. If you get it wrong, calls silently fail and nobody tells you why.
We offer Matrix RTC as an add-on. It is pre-configured, tested, and maintained. You toggle it on, calls work.
Spam will find you within weeks¶
A Matrix server with open registration is a honeypot. Registration-spam operators scan the public homeserver list, find servers with registration enabled, and sign up thousands of accounts. Those accounts spam the federation with cryptocurrency promotions and worse. The threat model is real enough that entire articles have been written about defending against it.
To protect yourself, you need:
- Registration tokens (so only people you invite can sign up)
- A federation deny-list to block known-bad servers
- Rate limiting on room creation and federation requests
- A moderation bot like Draupnir to ban spam accounts and manage abuse
- Someone to maintain all of the above
A community moderator on Matrix put it bluntly: “the Ubuntu Matrix Operators are working hard to block the spam before you even see it, they cannot catch everything.” And that is Ubuntu, with a dedicated team.
The full picture of what you are up against is in our moderation guide. It covers spammers, phishers, trolls, unwanted bots, illegal content, and how to coordinate with other server admins through communities like Muninn Hall so you are not fighting alone.
Our servers ship with registration tokens, federation deny-lists, and rate limiting configured out of the box. We also monitor for anomalies and alert you before a problem becomes a crisis. See our monitoring service for what that looks like.
There is no admin panel¶
Synapse does not have a first-party admin interface. For years, the only way to manage users, rooms, and media was the Synapse Admin API. Which means curl commands or a third-party tool.
We built Ketesa because we needed it ourselves. It runs in your browser, lets you manage users, schedule maintenance, view server status, and clear old media. No curl. No SSH. No separate deployment.
Your users will struggle to sign up¶
Here is the onboarding flow for a new user on a self-hosted Matrix server, as documented by someone who went through it recently:
- Download Element X (the app Element recommends).
- Tap “Create account”.
- Tap “Change account provider”.
- Tap “Other”.
- Search for your server.
- Element X tells you it cannot create a username-and-password account. You need SSO.
- Download Element Classic instead.
- Tap “Create account”.
- Element Classic tells you to use Element X.
- Go back to step 1.
We recommend a completely different set of apps. Our clients page has the full breakdown, but the short version: Komai on the desktop (native, Rust, no Electron), Cinny in the browser, and FluffyChat on your phone. All of them work with a self-hosted server without the loop above.
The real cost is not money¶
A VPS costs ten to thirty euros a month. The real cost is the weekend you spend debugging why federation stopped working, the morning you wake up to a full disk because the database grew overnight, the call that fails because your LiveKit configuration is wrong, the user who gives up because they cannot register.
One person who ran a Matrix server for five years wrote: “I will probably switch to Snikket.” After five years. Because the maintenance burden never stopped.
Another put it even more directly: “Self-hosting is not dying because people stopped caring. It is dying because the complexity has gotten out of hand.”
We agree. That is why we exist.
What we do instead¶
We run managed Matrix servers. You get the same freedom (your data, your domain, your server) without the maintenance.
Here is what is included:
- Weekly automated maintenance: database vacuum, media cleanup, system updates, everything that keeps a server healthy. Runs every week whether you think about it or not. Details on our services page.
- Monitoring: port checks, DNS validation, HTTP endpoint verification, VPS metrics. Alerts go to your email and your Matrix account. What we actually check is documented here.
- Ketesa: a proper admin panel for your server. Manage users, schedule maintenance, view server status, clear old media. All from your browser. See what it can do here.
- The Scheduler bot: the same controls from inside Matrix, if you already live there. Read about it here.
- Komai: our desktop client, native and fast. No Electron, no nonsense. Download it here.
- Matrix RTC: properly configured voice and video calls, as an add-on. It works. Details here.
- Bridges: connect Matrix to WhatsApp, Telegram, Signal, Discord, Slack, and more. Our bridges page has the full list. Bridges are the most common add-on, and they are one of the main reasons people run Matrix in the first place.
- Support: Basic support is included with every server. If you need more, Dedicated support puts you in a room with our developers.
You can bring your own server (on-premises) or we can rent one for you through Hetzner Cloud in the EU, US, or Asia. Sizes start at 2 vCPUs and 2 GB of RAM. Everything is on our order form.
We also maintain all of our code as open source, under AGPL-3.0. If you ever want to leave, your data is yours and you can reproduce the whole setup yourself. We are not a silo. We are experience and convenience, built on free software.
Freedom should not cost your weekends¶
Matrix is worth using. The protocol is solid, the community is real, and owning your communication is a genuinely good idea. But running a Matrix server is a job, and it is a job that does not end. The database keeps growing. The spam keeps trying. The calls keep breaking.
We do that job so you do not have to.
Order a managed server and get Matrix without a headache. Or talk to us if you want to know more. We answer questions from actual people who will know your server by name.