Self-host Matrix Synapse on a no-KYC VPS
Run your own Matrix homeserver in place of a Slack workspace or a Discord server: end-to-end encrypted chat with user IDs on your own domain, federated with every other Matrix server or closed to outsiders. Sign up with a generated credential and pay with crypto, card or cash.
- No email or ID
- IPv4 and a routed IPv6 /64
Which plan for which server
Synapse's appetite depends less on how many people you host than on which rooms they join.
| Blackbox plan | Why | |
|---|---|---|
| Family or a few friends | Core, 4 GB | Synapse and PostgreSQL with room to spare, as long as nobody joins the biggest public rooms. |
| Small team or community | Plus, 8 GB | Joining large federated rooms makes Synapse fetch and resolve their whole state, which costs memory, CPU and database space. |
| Busy community with bridges or group calls | Max, 16 GB | Each bridge is its own process, group calls need a LiveKit server, and Synapse can be split into workers. |
Plans
| Plan | vCPU | RAM | NVMe | Traffic | Where | Price |
|---|---|---|---|---|---|---|
| Blackbox Core | 2 | 4 GB | 50 GB | 4 TB per 31 days | MontrealAmsterdamNew York City (launch pre-order)Singapore (launch pre-order) | $9.99/mo |
| Blackbox Plus | 4 | 8 GB | 100 GB | 8 TB per 31 days | MontrealAmsterdamNew York City (launch pre-order)Singapore (launch pre-order) | $19.99/mo |
| Blackbox Max | 6 | 16 GB | 200 GB | 16 TB per 31 days | MontrealAmsterdamNew York City (launch pre-order)Singapore (launch pre-order) | $39.99/mo |
| Blackbox Ultra | 8 | 32 GB | 400 GB | 32 TB per 31 days | MontrealAmsterdamNew York City (launch pre-order)Singapore (launch pre-order) | $79.99/mo |
For a server that relays a lot of video, the standard VPS line in New York City, Singapore and Hong Kong has unmetered bandwidth. It has no IPv6 and no memory encryption.
Install Synapse with PostgreSQL
Docker Compose on Debian 12 or Ubuntu 24.04. Replace example.com with your domain before you run anything, and point matrix.example.com at the server.
# Debian 12 or Ubuntu 24.04, as root
curl -fsSL https://get.docker.com | sh
mkdir -p /opt/matrix && cd /opt/matrix
# 1. Config for server_name example.com, so IDs read
# @you:example.com. It cannot be changed later.
docker run --rm -v /opt/matrix/data:/data \
-e SYNAPSE_SERVER_NAME=example.com \
-e SYNAPSE_REPORT_STATS=no \
matrixdotorg/synapse:latest generate
# 2. Synapse and PostgreSQL (Synapse needs the C collation)
cat > compose.yml <<'EOF'
services:
db:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_USER: synapse
POSTGRES_PASSWORD: change-me
POSTGRES_INITDB_ARGS: --encoding=UTF-8 --lc-collate=C --lc-ctype=C
volumes: ["./pg:/var/lib/postgresql/data"]
synapse:
image: matrixdotorg/synapse:latest
restart: unless-stopped
depends_on: [db]
volumes: ["./data:/data"]
ports: ["127.0.0.1:8008:8008"]
EOF
# 3. In data/homeserver.yaml: replace the sqlite3 database
# block with psycopg2 (user synapse, password change-me,
# dbname synapse, host db) and set
# public_baseurl: https://matrix.example.com/
docker compose up -d
# 4. Your first account, as an admin
docker compose exec synapse register_new_matrix_user \
-c /data/homeserver.yaml -u admin -a http://localhost:8008Put Caddy in front
Caddy fetches the certificates. The two .well-known answers let user IDs end in example.com while Synapse runs on matrix.example.com, and they send federation traffic to port 443.
# /etc/caddy/Caddyfile (apt install caddy)
matrix.example.com {
reverse_proxy /_matrix/* localhost:8008
reverse_proxy /_synapse/client/* localhost:8008
}
# Delegation. If example.com is hosted elsewhere,
# serve these two answers from that web server.
example.com {
@server path /.well-known/matrix/server
@client path /.well-known/matrix/client
header /.well-known/matrix/* Content-Type application/json
header /.well-known/matrix/* Access-Control-Allow-Origin *
respond @server `{"m.server":"matrix.example.com:443"}`
respond @client `{"m.homeserver":{"base_url":"https://matrix.example.com"}}`
}
# Then log in with Element at https://app.element.io
# and check federation at federationtester.matrix.orgWhat to watch out for
server_name is permanent
It is the part after the colon in every user ID and room alias. Changing it later means a new server and new accounts, so pick the bare domain you want people to see.
Large public rooms are expensive
Joining a room with tens of thousands of members pulls its state and history into your database. That is what usually makes a small Synapse server run short of memory or disk.
Cached media keeps growing
Synapse keeps copies of images and files from other servers. Set media_retention with a remote_media_lifetime in homeserver.yaml and copies nobody has opened in that time get deleted.
Calls need more than Synapse
One-to-one calls need a TURN server such as coturn for people behind NAT. Group calls in Element Call need a LiveKit server. Relayed audio and video count toward your transfer.
Backups are yours to run
Copy the PostgreSQL database and the data directory, which holds homeserver.yaml, the media store and the server's signing key. Servury has no snapshot product to fall back on.
What end-to-end encryption leaves on the server
Matrix encrypts message content end to end, but your homeserver still holds room membership, timestamps, profiles and every message in unencrypted rooms. On Blackbox that data stays encrypted in memory while Synapse runs, and on disk too if you turn on disk encryption.
- AMD SEV-SNP memory encryption on Linux images, with measured boot you can check yourself with blackbox-verify.
- With disk encryption on, the server waits for your passphrase after each reboot. You type it over SSH before the system starts.
- No guest agent, so there is no channel for the host to run commands inside.
- IPv4 plus a routed IPv6 /64 on a 10 Gbps port.
- 4 to 32 TB of transfer per 31 days depending on the plan, then 10 Mbps until the period rolls over.
Questions
How much server do I need?
Blackbox Core, with 2 vCPU and 4 GB, runs Synapse and PostgreSQL for a family or a small group. Joining large public rooms is what drives memory, CPU and database size up, so a team or community that does should start on Plus with 8 GB. Uploads and cached media from other servers fill the disk over time.
Should I use Synapse, Dendrite or Conduit?
Synapse, written and maintained by Element, has the longest track record and the most documentation, and it is the safe default. Conduit and its forks, such as continuwuity and tuwunel, are single Rust binaries with an embedded database and low system requirements. Conduit itself is still in beta. Dendrite, written in Go, is in maintenance mode and gets only security fixes.
Do I need DNS records on both the domain and a matrix subdomain?
Usually, yes. Point matrix.example.com at the server and run Synapse there, then serve two small files under example.com/.well-known/matrix/: one tells other servers where to find you, the other tells apps. User IDs then read @you:example.com, and your main website can stay wherever it is hosted now.
Is federation required?
No. For a private server, set federation_domain_whitelist to an empty list in homeserver.yaml and leave out the .well-known/matrix/server file. Accounts on your server can then talk only to each other.
How do I stop strangers from signing up?
Registration is off unless you turn it on: enable_registration defaults to false. Create accounts with register_new_matrix_user, or set enable_registration and registration_requires_token both to true so only people holding a token you made through the admin API can join.
Which apps work with it?
Any Matrix client. Element runs on the web, desktop, iOS and Android. Cinny, FluffyChat, Nheko and SchildiChat are other options.
Can I bridge to Discord, Slack or other networks?
Yes, with mautrix-discord and mautrix-slack. Each bridge runs as its own container next to Synapse and is registered in homeserver.yaml as an application service. Messages go both ways. mautrix-telegram, mautrix-signal and mautrix-whatsapp work the same way, and Heisenbridge connects IRC.
Does Servury log my Matrix traffic?
No. We keep no traffic logs, and Blackbox runs no agent inside your server. Whatever your homeserver stores sits in your own database.
Guides on this topic
- Self-Hosted Apps vs SaaS: Why Running Your Own Nextcloud, Vaultwarden, or Pi-hole Beats Trusting a Third PartyWhat changes when you run your own Nextcloud, Vaultwarden, or Pi-hole instead of trusting a SaaS provider, and how an anonymous VPS narrows the last privacy...
- How to Set Up a Self-Hosted VPN with WireGuard on a VPSTen minutes from a fresh Ubuntu server to a WireGuard VPN you control: keys, config, forwarding, firewall, a phone client by QR code, and the two settings that...
- Why Developers Are Self-Hosting AI Agents and LLMs Instead of Relying on Cloud AI PlatformsWhy developers are moving language models and agents onto their own VPS, keeping prompts, documents, and agent memory private instead of sending them to a...
- Anonymity vs Privacy: What Your VPS Provider Can Still SeePrivacy means your VPS provider promises not to look. Anonymity means it never collected the data. What a provider can still see, and what to check.