Run your own Matrix server: Synapse and the lighter options
This page contains affiliate links. If you buy through them, this site may earn a commission at no extra cost to you. How affiliate links work here.
For most people, Matrix server hosting means Synapse, the reference homeserver, running in Docker with a Postgres database behind a reverse proxy on a small VPS. If you want something lighter, Tuwunel, Continuwuity and Conduit are maintained Rust servers that describe themselves as fast and lightweight, though none has documentation as extensive as Synapse’s. Whichever you pick, decide on your domain first, because the server name cannot be changed later.
New to the protocol? Start with the Matrix section of this handbook.
At a glance
| Step | What you need |
|---|---|
| Server | A Linux VPS or home server with a public IP; 2 GB RAM is a sensible floor for Synapse with Postgres |
| Domain | A domain you control, such as example.org, plus a subdomain such as matrix.example.org |
| Software | Docker with Compose, Synapse, Postgres, and a reverse proxy (Caddy below) |
| Ports | 80 and 443 with delegation; 8448 only without it |
| Optional | TURN for one-to-one calls, a LiveKit backend for Element Call |
| Time | An evening for a working server; ongoing updates every few weeks |
Pick a homeserver
The table below only repeats what each project’s own repository or site says, as of 2026-12-02:
| Server | Language | Licence | Status (from the project itself) |
|---|---|---|---|
| Synapse | Python and Rust | AGPL-3.0, or a commercial licence from Element | Maintained by Element at github.com/element-hq/synapse; regular releases (v1.166.0 is the newest stable release) |
| Dendrite | Go | AGPL-3.0 or commercial | “In maintenance mode, meaning only security fixes are being applied”; described as beta |
| Conduit | Rust | Apache-2.0 | Described as beta; v0.10.17 released November 2026 |
| conduwuit | Rust | Apache-2.0 | Repository archived on May 29, 2026; its README names Tuwunel as the official successor |
| Tuwunel | Rust | Apache-2.0 | Calls itself the official successor to conduwuit; v2.1.0 released November 2026 |
| Continuwuity | Rust | Apache-2.0 | “The official community continuation of the conduwuit homeserver”; v26.11.0 released November 30, 2026 |
Synapse is the safe default. It has the most complete documentation, an official Docker image and Postgres guide, and it is the server Element builds its own stack on. Its README now points to the Element Server Suite (ESS) as the official deployment route, but the standalone Docker image is still documented and is what this guide uses.
Pick a Rust server for very small hardware or a Raspberry Pi home server serving a handful of people. Conduit’s site describes it as “a single binary with an embedded database”, which removes Postgres from the picture. Avoid starting a new server on Dendrite or conduwuit.
Hardware and hosting
The Synapse installation docs ask for at least 1 GB of free RAM if you want to join large public rooms such as #matrix:matrix.org. Postgres, the reverse proxy and the operating system need memory too, so plan for 2 GB as a minimum and 4 GB if you will join big federated rooms. Element’s ESS Community quick setup, which runs on Kubernetes, asks for at least 2 CPU cores and 2 GB of memory. Disk use grows with uploaded media and the database; back both up.
A VPS is simplest: a fixed public IP and no home router in the way. Compare options in VPS vs home server vs managed hosting.
| Provider and plan | vCPU | RAM | Disk | Monthly price | Notes |
|---|---|---|---|---|---|
| DigitalOcean Basic Droplet | 1 | 2 GiB | 50 GiB SSD | $12.00 | 2,000 GiB transfer |
| DigitalOcean Basic Droplet | 2 | 4 GiB | 80 GiB SSD | $24.00 | 4,000 GiB transfer |
| Vultr Regular Performance | 1 | 2 GB | 55 GB SSD | $10.00 | 2 TB bandwidth |
| Vultr Regular Performance | 2 | 4 GB | 80 GB SSD | $20.00 | 3 TB bandwidth |
| Hostinger KVM 1 | 1 | 4 GB | 50 GB NVMe | $11.99 | Regular price; requires a 24-month term paid upfront |
| Hetzner CPX12 | 1 | 2 GB | 40 GB NVMe | from €9.99 excl. VAT | Price varies by location |
| Hetzner CPX22 | 2 | 4 GB | 80 GB NVMe | from €16.99 excl. VAT | Price varies by location |
Prices checked 2026-12-02 on each provider’s pricing page. To compare a full year including storage and backups, use the self-hosting cost calculator, and see the best VPS for self-hosting for how these providers differ beyond price.
Domain and .well-known delegation
Your server name is the part after the colon in @alice:example.org. The installation docs recommend using your main domain rather than a Matrix-specific hostname, the same way your email address uses example.org.
By default, other servers try to reach yours at the server name on port 8448. Delegation lets you keep example.org as the server name while Synapse actually runs at matrix.example.org on port 443. You publish two small JSON files on https://example.org:
/.well-known/matrix/servertells other servers where to connect:{"m.server": "matrix.example.org:443"}./.well-known/matrix/clienttells apps which URL to use:{"m.homeserver": {"base_url": "https://matrix.example.org"}}. It must be served with anAccess-Control-Allow-Origin: *header so browser clients can read it.
Create DNS A (and AAAA, if you have IPv6) records for both example.org and matrix.example.org pointing at your server. If example.org already hosts a website elsewhere, serve the two files from that website instead. The delegation docs advise against SRV records because they make TLS certificates harder to get right.
Synapse with Docker Compose and Postgres
The Synapse repository ships an example docker-compose.yml in contrib/docker. The version below keeps its services, environment and volumes, and changes only this: it drops the build: section, the Traefik labels (you will use Caddy) and the obsolete version: line, gives the database the same restart policy, and publishes port 8008 on 127.0.0.1 only, so nothing reaches Synapse except through the reverse proxy. The Compose reference documents that host-IP form and warns that without it Docker binds to all interfaces and can bypass your firewall.
Create a directory such as ~/synapse and save this as compose.yaml:
services:
synapse:
image: docker.io/matrixdotorg/synapse:latest
# Since synapse does not retry to connect to the database, restart upon
# failure
restart: unless-stopped
# NOTE: You must edit homeserver.yaml to use postgres, it defaults to sqlite
environment:
- SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
volumes:
- ./files:/data
depends_on:
- db
ports:
- "127.0.0.1:8008:8008"
db:
image: docker.io/postgres:15-alpine
restart: unless-stopped
environment:
- POSTGRES_USER=synapse
- POSTGRES_PASSWORD=CHANGE_ME
# ensure the database gets created correctly
# https://element-hq.github.io/synapse/latest/postgres.html#set-up-database
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
volumes:
- ./schemas:/var/lib/postgresql/data
The POSTGRES_INITDB_ARGS line matters. The Postgres docs for Synapse say the database must be created with UTF-8 encoding and the C locale, and Synapse refuses to start on a database with the wrong COLLATE and CTYPE values. The postgres image only applies these settings when its data directory is empty, so get it right before the first start. Synapse supports Postgres versions until they reach upstream end of life, so a newer major version also works on a fresh install; from 18 on, the image docs say to mount the volume at /var/lib/postgresql instead.
Generate the config, with your real server name (the Synapse docs use the older docker-compose spelling of the same command):
docker compose run --rm -e SYNAPSE_SERVER_NAME=example.org -e SYNAPSE_REPORT_STATS=no synapse generate
This writes homeserver.yaml and a signing key into ./files. Open files/homeserver.yaml and replace the default SQLite database section with the Postgres one from the Synapse docs. With the postgres image, the database name defaults to the user name, and db is the service name in the Compose file:
database:
name: psycopg2
args:
user: synapse
password: CHANGE_ME
dbname: synapse
host: db
cp_min: 5
cp_max: 10
In the same file, set public_baseurl to the URL clients use, and check that the port 8008 listener has x_forwarded: true, as the reverse proxy docs require:
public_baseurl: "https://matrix.example.org"
Do not change bind_addresses to 127.0.0.1 inside the container; the reverse proxy docs warn this stops a containerized Synapse from answering proxied traffic. Start everything with docker compose up -d.
Create your first account from the command line. The generated config already contains a random registration_shared_secret, and anyone who knows it can create accounts, including admins, so keep it private:
docker compose exec synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml
Answer yes to “Make admin” for your own account. Leave enable_registration off unless you plan to run open sign-ups and the moderation they bring.
Reverse proxy and TLS
Synapse’s reverse proxy guide forwards only /_matrix and /_synapse/client to Synapse. Caddy is the shortest path because it obtains and renews Let’s Encrypt or ZeroSSL certificates on its own, as long as your DNS records point at the server and ports 80 and 443 are open. This Caddyfile combines the Synapse docs’ Caddy and delegation examples, with the optional identity server line removed:
example.org {
header /.well-known/matrix/* Content-Type application/json
header /.well-known/matrix/* Access-Control-Allow-Origin *
respond /.well-known/matrix/server `{"m.server": "matrix.example.org:443"}`
respond /.well-known/matrix/client `{"m.homeserver":{"base_url":"https://matrix.example.org"}}`
}
matrix.example.org {
reverse_proxy /_matrix/* localhost:8008
reverse_proxy /_synapse/client/* localhost:8008
}
Because federation is delegated to port 443, you do not need to open 8448. The docs also cover nginx and Apache; with nginx, add no path after the port in proxy_pass, and with Apache keep nocanon, or federation signatures fail.
Keep the admin API private
Everything under /_synapse/admin is the admin API. It needs an admin access token, but the Synapse docs recommend not exposing it to the public internet without good reason. The Caddyfile above never forwards that path, so the admin API is only reachable on the server itself at http://localhost:8008. Run admin requests from an SSH session on the server, or through an SSH tunnel from your laptop. For example, this upgrade-doc command shows the running version:
curl http://localhost:8008/_synapse/admin/v1/server_version
Put any web admin panel behind a VPN or IP allowlist.
Test federation
Open the Matrix Federation Tester and enter example.org. It checks delegation, certificates and the federation API. Then join #synapse:matrix.org from your account; the federation docs suggest it as a first room. A “401: Unauthorized” error when joining usually means other servers cannot reach yours. Also avoid HTTP 308 redirects on example.org, because Synapse does not follow them over federation.
Do you need an identity server?
Generally, no. An identity server maps email addresses and phone numbers to Matrix IDs so people can find each other by contact details. Synapse sends its own password reset and verification emails once you fill in the email section with SMTP details, and the identity server entry in the client .well-known file is optional.
Calls: TURN and Element Call
The Synapse docs say that for reliable VoIP calls through your server you must configure a TURN server, either coturn or eturnal, on a host with a public IP. Synapse then needs turn_uris, turn_shared_secret, turn_user_lifetime and turn_allow_guests in homeserver.yaml. Open TCP and UDP ports 3478 and 5349 and the UDP relay range 49152-65535; the classic symptom of a broken setup is calls stuck at “connecting”.
Element Call, which the Element X, Element Web and Element Desktop apps use for in-app calls, works differently. Its self-hosting guide requires a dedicated LiveKit SFU plus the MatrixRTC Authorization Service (lk-jwt-service), and several experimental features enabled in Synapse. Plan that as a separate project after chat works. ESS Community bundles this backend if you would rather not assemble it yourself.
Updates and backups
Synapse releases arrive every couple of weeks. Before each upgrade, read the upgrade notes for version-specific steps and check that your Postgres version is still supported, then pull the new image and recreate the container. Keep the host OS patched too.
The backup docs list what to keep: homeserver.yaml and other config files, the signing key, the database, and the local_content and local_thumbnails media folders. Remote media and URL preview caches can be skipped. For the database, the docs recommend pg_dump in custom format and excluding the one-time-keys table, which avoids decryption errors after a restore:
docker compose exec db pg_dump -U synapse -Fc --exclude-table-data e2e_one_time_keys_json synapse > synapse.dump
There is no need to stop Synapse while it runs. Restore only into a freshly created database, never over an existing one. Copy dumps and media off the server.
Managed alternatives
Self-hosting is the wrong choice if nobody will apply updates or watch disk space. Matrix.org keeps a list of nine hosting providers, including etke.cc, Federated Computer and IndieHosters, with the note that the Foundation does not endorse them. etke.cc runs managed Matrix servers on a VPS it rents for you or on your own server, and its order page showed no pause on new orders when checked. Element’s pricing page lists only self-hosted plans: the free Community edition for 1 to 100 users, plus Enterprise (from 100 users) and Sovereign plans that go through sales, so it offers no Element-hosted option for a small group.
Once your server runs, add a Telegram bridge or a few Matrix bots.
Frequently asked questions
- Can I change my Matrix server name later?
- No. The Synapse installation docs say the server name cannot be changed after installation, because it becomes part of every user ID and room alias. Pick the domain you want to keep, such as example.org, and use delegation to run the server on a subdomain.
- Do I have to open port 8448?
- Not if you use .well-known delegation. Other servers look for port 8448 by default, but a /.well-known/matrix/server file that points to matrix.example.org:443 sends federation traffic to port 443 instead, so one HTTPS port covers clients and servers.
- Do I need an identity server?
- Usually not. An identity server only maps email addresses and phone numbers to Matrix IDs. Synapse can send password reset and verification emails itself once SMTP is configured, and the identity server entry in the client .well-known file is optional.
- Can I use SQLite instead of Postgres?
- Only for testing. The Synapse docs say SQLite should not be used on a production server and performs poorly in large rooms. Start with Postgres, because moving later means running the port script and taking downtime.
- Is Synapse the only maintained Matrix server?
- No. Tuwunel, Continuwuity and Conduit are Rust servers with releases in late 2026. Dendrite is in maintenance mode with security fixes only, and the conduwuit repository was archived in May 2026.
Sources, checked December 2, 2026
- Synapse repository README (licence and ESS)
- Synapse AGPL-3.0 licence file
- Synapse releases
- Synapse docs: Installation instructions
- Synapse docs: Using Postgres
- Synapse docs: Delegation of incoming federation traffic
- Synapse docs: Using a reverse proxy with Synapse
- Synapse docs: Setting up federation
- Synapse docs: Overview of TURN setup
- Synapse docs: How to back up a Synapse homeserver
- Synapse docs: Upgrading Synapse
- Synapse docs: The Admin API
- Synapse docs: Deprecation policy
- Synapse Docker image README
- Synapse contrib/docker (docker-compose.yml and README)
- Dendrite repository README (maintenance mode)
- conduwuit repository (archived)
- Tuwunel repository README
- Tuwunel releases
- Continuwuity repository and releases
- Conduit project site
- Conduit releases
- Element Call self-hosting guide (MatrixRTC and LiveKit)
- ESS Community (ess-helm) README
- Element pricing
- Matrix.org: Hosting providers
- etke.cc managed Matrix hosting
- etke.cc order page
- Matrix Federation Tester
- Docker Official Image: postgres
- Compose file reference: ports
- Caddy: Automatic HTTPS
- DigitalOcean Droplet pricing
- Vultr pricing
- Hostinger VPS hosting plans
- Hetzner Cloud Regular Performance plans