Skip to content

Matrix Synapse on a VPS

Matrix protocol server

Author
Element
License
AGPL-3.0
Version
1.162.0

The script is free · VPS from $4.63 per month · installs in about 2 minutes

Install over SSH

root@vps:~# command -v docker >/dev/null || curl -fsSL https://get.docker.com | sh; S=matrix.example.com; docker run --rm -v synapse-data:/data -e SYNAPSE_SERVER_NAME=$S -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse:latest generate && docker run -d --name synapse --restart unless-stopped -v synapse-data:/data -p 8008:8008 matrixdotorg/synapse:latest

  • SystemUbuntu 24.04 · x86_64ok
  • Sourcegithub.com/element-hq/synapseok
  • Version1.162.0ok
  • Port8008/tcplisten
  • Port8448/tcplisten

✓ Matrix Synapse 1.162.0 installed · about 2 minutes

root@vps:~#

Install command from the library. Output is shortened and may differ on your server.

What it is

  • Matrix
  • Messenger
  • Encryption
  • Federation

Synapse is a server for the Matrix protocol, a decentralized messenger with end-to-end encryption. Users on your server can chat with each other and with users on other Matrix servers.

Your own server is a messenger for your team or community that no one can shut down or read. Clients: Element and other Matrix apps for every platform.

The command first generates a homeserver.yaml config for your domain, then starts the server from the official image with an SQLite database.

  • End-to-end encryption
  • Federation with other Matrix servers
  • Element client for every platform
  • Bridges to Telegram, Discord, WhatsApp
  • Rooms, spaces and calls

Recommended plan

For Matrix Synapse: at least 2 vCPU, 3 GB RAM and 45 GB NVMe.

Minimum to run
1 vCPU · 1 GB RAM · 10 GB disk
Systems
Ubuntu 22.04 · Ubuntu 24.04 · Debian 12

How to install

Three steps in the bot or one command over SSH; installation takes about 2 minutes.

  1. 01

    Choose a plan in the bot

    Open @ExpressHost_bot and pay for a VPS. The server will be ready in about 60 seconds.

  2. 02

    Add Matrix Synapse

    At the “Add-ons” step pick the script from the library, or run it later: Server settings → Scripts.

  3. 03

    Finish the setup

    Before starting, replace matrix.example.com with your domain: the server name cannot be changed later

Manually over SSH

Connect to the server as root and run the command. Supported systems: Ubuntu 22.04, Ubuntu 24.04, Debian 12.

Install command
command -v docker >/dev/null || curl -fsSL https://get.docker.com | sh; S=matrix.example.com; docker run --rm -v synapse-data:/data -e SYNAPSE_SERVER_NAME=$S -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse:latest generate && docker run -d --name synapse --restart unless-stopped -v synapse-data:/data -p 8008:8008 matrixdotorg/synapse:latest

Ports

Matrix Synapse ports
PortProtocolPurpose
8008tcpClient API (behind an HTTPS proxy)
8448tcpFederation (via proxy or .well-known)

After installation

  1. 1.Before starting, replace matrix.example.com with your domain: the server name cannot be changed later
  2. 2.Set up an HTTPS proxy to port 8008 for the domain
  3. 3.Create a user: docker exec -it synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml -a
  4. 4.Sign in to Element, specifying your server

Matrix Synapse FAQ

Didn’t find an answer? Message @ExpressHost_SupportBot.

Is SQLite good enough for production?

For testing and a few users, yes. For long-term use, the developers recommend PostgreSQL.

How do I update Synapse?

Run docker pull matrixdotorg/synapse:latest and recreate the container with the second command from the installation.

Where is the data stored?

In the synapse-data Docker volume: homeserver.yaml, signing keys, the database and media.

Matrix Synapse installs at checkout.