A Note on the Domain
Matrix uses two names: the server name (the part after the colon in @user:example.com) and the actual hostname Synapse runs on. Keeping them the same domain is simplest. This guide assumes you own example.com and will serve Synapse at matrix.example.com, with the server name delegated to it.
Step 1: Install Docker
curl -fsSL https://get.docker.com | shStep 2: Generate the Config
Synapse ships a one-shot generator. Run it to create the config, then edit it:
mkdir -p synapse-data
docker run --rm \
-v $(pwd)/synapse-data:/data \
-e SYNAPSE_SERVER_NAME=example.com \
-e SYNAPSE_REPORT_STATS=no \
matrixdotorg/synapse:latest generateStep 3: Compose with Caddy HTTPS
Save as docker-compose.yml:
services:
synapse:
image: matrixdotorg/synapse:latest
restart: always
volumes:
- ./synapse-data:/data
caddy:
image: caddy:2-alpine
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
depends_on:
- synapse
volumes:
caddy_data:Step 4: The Caddyfile (with Delegation)
The extra example.com block tells other servers where to find yours (well-known delegation), so your user IDs can be the clean @you:example.com:
matrix.example.com {
reverse_proxy synapse:8008
}
example.com {
handle /.well-known/matrix/server {
header Content-Type application/json
respond `{"m.server": "matrix.example.com:443"}`
}
}Bring it up:
docker compose up -dStep 5: Create Your Account
Registration is closed by default (good). Create your admin user from the command line:
docker compose exec synapse register_new_matrix_user -c /data/homeserver.yaml http://localhost:8008Now log in with any Matrix client (Element is the popular one), using matrix.example.com as the homeserver. Turn on end-to-end encryption in your rooms and you have private chat no platform can read.
What It Costs
A personal or small-group Synapse runs on the Standard plan (2 vCPU, 4 GB); federation and media add some load, so give it a little headroom. On NoctHost that is hourly billing from a prepaid balance topped up with crypto — no card, no KYC — which matches the point of running your own chat server: no company in the middle.