- Networking and privacy
- Linux VPS
- Ubuntu 24.04
Self-host a Matrix server on a VPS
A Matrix homeserver with Synapse runs well on a GhostRDP Linux VPS Standard plan with 4 vCPU and 8 GB RAM in Germany or the Netherlands, from €12.99/mo.
Matrix is an open, federated chat network. With your own homeserver, your accounts and messages live on a server you control, and you still talk to people on other Matrix servers. This guide uses the matrix.org packages from the Synapse docs.
Your own chat server
Accounts and rooms on a server you control.
Federated
Talk to people on any other Matrix server.
End-to-end encryption
Element and other clients encrypt private chats.
Plans for Matrix (Synapse)
A small server for friends or a team runs on Basic. Joining large public rooms uses much more memory, so Standard or Pro is the safer choice for that.
Linux VPS Basic
€5.99/mo
€5.09/mo billed yearly, save €10/year
- 2 vCPU
- 6 GB ECC RAM
- 40 GB NVMe
- 1 Gbps port
Linux VPS Standard
€12.99/mo
€11.04/mo billed yearly, save €23/year
- 4 vCPU
- 8 GB ECC RAM
- 70 GB NVMe
- 1 Gbps port
Linux VPS Pro
€25.99/mo
€22.09/mo billed yearly, save €46/year
- 6 vCPU
- 12 GB ECC RAM
- 90 GB NVMe
- 1 Gbps port
What you need
- Operating systemLinux VPS with Ubuntu 24.04 (the packages are amd64 only)
- DomainA domain with an A record such as matrix.example.com pointing to your server
- Server nameDecide it first: Synapse can't change it later
Official site: Synapse docs
How to install Matrix (Synapse)
Written for Ubuntu 24.04 from the official instructions. Run the commands as root and replace YOUR_SERVER_IP with your server's address.
- 1
Connect to your server over SSH
Use the IP address and root password from your welcome email (the server page has a Copy SSH command button). Windows 10 and 11, macOS and Linux all include an SSH client in the terminal.
Shell ssh root@YOUR_SERVER_IP - 2
Update the system
Install the latest security updates before you add anything else.
Shell apt update && apt -y upgrade - 3
Add the matrix.org repository and install Synapse
The commands from the Synapse install docs. The installer asks for your server name: use your domain, for example matrix.example.com.
Shell apt install -y lsb-release wget apt-transport-https wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/matrix-org.list apt update apt install -y matrix-synapse-py3 - 4
Add HTTPS with Caddy
Caddy gets a certificate automatically and passes Matrix traffic to Synapse on port 8008. Port 8448 is for other Matrix servers. Replace the domain with yours.
Shell apt install -y caddy cat > /etc/caddy/Caddyfile <<EOF matrix.example.com, matrix.example.com:8448 { reverse_proxy /_matrix/* localhost:8008 reverse_proxy /_synapse/client/* localhost:8008 } EOF systemctl reload caddy - 5
Create your first user
Adds a registration secret, restarts Synapse and creates an admin account. Answer yes when it asks whether to make an admin.
Shell echo "registration_shared_secret: $(openssl rand -hex 32)" > /etc/matrix-synapse/conf.d/registration.yaml systemctl restart matrix-synapse register_new_matrix_user -c /etc/matrix-synapse/conf.d/registration.yaml http://localhost:8008
After installing
- Sign inIn Element or another Matrix client, choose your own homeserver, enter https://matrix.example.com and sign in.
- Use PostgreSQL for real useThe package starts with SQLite, which the Synapse docs call acceptable only for testing. Move to PostgreSQL before you invite many people.
- FirewallAllow 22, 80, 443 and 8448 over TCP; Synapse's own port 8008 stays local.
Matrix (Synapse) questions
Which plan do I need for Matrix?
Basic for a few people. Joining big public rooms uses a lot of memory, so pick Standard or Pro for that.
Do I need a domain?
Yes. Matrix user IDs include your server name, and HTTPS needs a domain. Choose it carefully, because Synapse can't change it later.
Can I talk to people on matrix.org?
Yes. Matrix is federated, so your server talks to other homeservers over port 8448.
Can I let anyone register?
You can, but open registration attracts spam accounts, and spam from your server breaks our rules. Create accounts yourself or use invite tokens.
Related apps
Jitsi Meet
Your own video meeting server, no accounts needed
Networking and privacyFrom €12.99/mo
Nextcloud
Your own cloud for files, calendar and contacts
StorageFrom €12.99/mo
Vaultwarden
Self-hosted password manager for the Bitwarden apps
Networking and privacyFrom €5.99/mo
More on GhostRDP
Run Matrix (Synapse) on your own server.
Online in minutes. Pay with crypto, no ID needed.