# How do I run a Matrix Synapse server on a VPS?

> Run Matrix Synapse 1.164 on a Linux VPS: server name, PostgreSQL, nginx on port 443, federation, email on port 587 and plan sizes. Crypto, no KYC.

- URL: https://vpswithcrypto.com/matrix-synapse-on-a-vps/
- Last updated: 2026-11-03
- Publisher: VPS With Crypto (https://vpswithcrypto.com)

Server name, packages, PostgreSQL, reverse proxy, first admin account, outgoing mail with port 25 closed, backups and the plan that fits: a Synapse homeserver on a Linux VPS, with the commands from the official documentation as of November 2026.

**Quick answer — How do I set up a Matrix Synapse homeserver on a VPS?**

Install Synapse from the packages.matrix.org repository on Debian or Ubuntu, store its data in PostgreSQL, put nginx with a TLS certificate in front on port 443, and choose the server name first, because it cannot be changed later. Synapse 1.164.2 was the current release on 3 November 2026. On VPS With Crypto, Kilo (2 vCPU / 4 GB / 65 GB) suits a small private server; Synapse asks for at least 1 GB of free RAM to join large public rooms.

## What do I have to decide before installing Synapse?

**The server name comes first.** It is the part after the colon in every user ID and room alias, as in `@alice:example.com`, and Synapse's installation guide says it cannot be changed later. Pick the domain you will keep for years, not the hostname of the VPS.

The server name and the machine can differ. With delegation, `example.com` stays the name while Synapse runs on `matrix.example.com`: you serve a small JSON file at `https://example.com/.well-known/matrix/server`, and other homeservers follow it. Without that file, they try your server name on port 8448.

Settle two more things now. Will strangers be able to sign up, or will you create accounts by hand? Will the server federate with the rest of the Matrix network, or stay private? Both answers shape the configuration and the work that follows. Before any of it, [secure the VPS](https://vpswithcrypto.com/first-ten-minutes-on-a-linux-vps/ "What should you do in the first ten minutes on a new Linux VPS?"): SSH keys, updates, a firewall.

*https://example.com/.well-known/matrix/server*

```json
{
  "m.server": "matrix.example.com:443"
}
```

## How do I install Synapse on Debian or Ubuntu?

**Use the packages the Synapse team publishes at packages.matrix.org.** On 3 November 2026 the repository carried 1.164.2 for Debian 13 (trixie) and 12 (bookworm) and for Ubuntu 24.04 (noble) and 22.04 (jammy), four of the images offered with every plan: Debian 13, Debian 12, Ubuntu 24.04 LTS, Ubuntu 22.04 LTS, AlmaLinux 10, Rocky Linux 10. The packages are built for amd64.

The package asks for the server name during installation and writes the main configuration to `/etc/matrix-synapse/homeserver.yaml`. Put your own settings in separate files under `/etc/matrix-synapse/conf.d/`: package upgrades then never ask whether to replace your configuration.

*Add the Matrix.org repository and install Synapse*

```bash
sudo apt install -y lsb-release wget apt-transport-https
sudo 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" |
  sudo tee /etc/apt/sources.list.d/matrix-org.list
sudo apt update
sudo apt install matrix-synapse-py3
```

## Why PostgreSQL rather than SQLite?

**Synapse's documentation says almost all installations should use PostgreSQL, and that SQLite should not be used on a production server.** SQLite is fine for a test you will throw away. Moving a live server to PostgreSQL later means a migration with downtime, so start with it.

Create a database user and a database with the `C` locale, as the Synapse PostgreSQL guide asks, then point Synapse at it from a file in `conf.d` and restart the service.

*Create the database*

```bash
sudo apt install postgresql
sudo -u postgres createuser --pwprompt synapse_user
sudo -u postgres createdb --encoding=UTF8 --locale=C --template=template0 --owner=synapse_user synapse
```

*/etc/matrix-synapse/conf.d/database.yaml*

```yaml
database:
  name: psycopg2
  args:
    user: synapse_user
    password: "the-password-you-chose"
    dbname: synapse
    host: localhost
    cp_min: 5
    cp_max: 10
```

## Which ports and reverse proxy does Synapse need?

**Synapse listens on `localhost:8008` over plain HTTP; nginx in front of it handles TLS.** Clients connect on 443. Other homeservers use 8448 by default, or 443 when your `.well-known` file says so. In the firewall, open 22 for SSH, 80 for the Let's Encrypt challenge, 443, and 8448 only if you skip delegation.

Two settings are easy to miss. nginx refuses request bodies over 1 MB by default, so raise `client_max_body_size` to match Synapse's `max_upload_size`, which defaults to 50M. And set `x_forwarded: true` on the 8008 listener in `homeserver.yaml`, so Synapse sees the real client address instead of 127.0.0.1.

*/etc/nginx/sites-available/matrix (certificate from certbot)*

```nginx
server {
    listen 443 ssl;
    listen [::]:443 ssl;
    # federation on 8448: drop these two lines if you delegate to 443
    listen 8448 ssl default_server;
    listen [::]:8448 ssl default_server;
    server_name matrix.example.com;
    ssl_certificate     /etc/letsencrypt/live/matrix.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/matrix.example.com/privkey.pem;

    location ~ ^(/_matrix|/_synapse/client) {
        proxy_pass http://localhost:8008;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $host;
        client_max_body_size 50M;
        proxy_http_version 1.1;
    }
}
```

## How do I create the first account and keep sign-ups closed?

**Create accounts from the server itself with `register_new_matrix_user`.** It talks to the running Synapse and authenticates with `registration_shared_secret`; if your configuration has none, add one in a `conf.d` file and restart. Synapse's guide warns that anyone who holds this secret can create accounts, admins included, even with registration closed. Keep it out of repositories, tickets and chats.

Leave `enable_registration: false` unless you want an open server, which brings spam sign-ups and moderation work.

Voice and video calls are the other gap on a fresh install. Synapse's documentation says reliable VoIP through your homeserver needs a TURN server, usually coturn on the same VPS or another one.

*First admin account*

```bash
sudo register_new_matrix_user -c /etc/matrix-synapse/homeserver.yaml http://localhost:8008
```

## How does Synapse send email when port 25 is closed?

**Through a mail provider on a submission port.** Outbound port 25 is closed on every VPS and is not opened on request; send mail through a mail provider on port 465 or 587. Synapse uses mail for password resets, address verification and notifications, and it works with any provider that accepts authenticated mail on 587 (STARTTLS) or 465 (TLS from the first byte).

Set the port explicitly. When `smtp_port` is left empty, Synapse picks 25, or 465 if `force_tls` is true. For 465, write `smtp_port: 465` and `force_tls: true` instead of the STARTTLS line below.

*/etc/matrix-synapse/conf.d/email.yaml*

```yaml
email:
  smtp_host: smtp.your-provider.example
  smtp_port: 587
  smtp_user: "matrix@example.com"
  smtp_pass: "app-password-from-the-provider"
  require_transport_security: true
  notif_from: "Matrix on example.com <matrix@example.com>"
```

## Which plan fits a Synapse server?

**Start from Synapse's own figure: at least 1 GB of free RAM to join large public rooms.** PostgreSQL, nginx and the system need memory on top of that, and a server that joins big federated rooms stores their state in its database. The rows below are starting points derived from that figure, not load tests. The vCPU of every plan are shared: they are scheduled on physical cores that neighbouring VPS also use. The RAM and NVMe space of your plan are reserved for your VPS only.

*Sizes are vCPU / RAM / NVMe. Prices are per month on a 12-month term, the same in all six cities.*

| Plan | Size | Fits | 12-month price a month |
| --- | --- | --- | --- |
| Byte | 1 vCPU / 2 GB / 40 GB | A test server, or a few accounts that stay out of large public rooms | $2.25 |
| Kilo | 2 vCPU / 4 GB / 65 GB | A family or small team server with federation on | $4.49 |
| Mega | 2 vCPU / 6 GB / 120 GB | A team that joins large public rooms, with disk for shared files | $6.75 |
| Giga | 4 vCPU / 8 GB / 160 GB | A community server with many active rooms, plus coturn | $13.50 |

## What do I back up?

**Three things, copied off the VPS.** No plan includes backups, so keep your own copy of anything that matters.

- **The database**, with `pg_dump`: users, rooms, messages and room state.
- **The media store**, the directory set by `media_store_path`: every uploaded file and avatar.
- **The signing key**, the file set by `signing_key_path`: it identifies your server to the rest of the federation, so a restore without it looks like a different server.

Keep the configuration files in `conf.d` with them. A copy on the same disk does not survive the loss of the VPS; the [migration guide](https://vpswithcrypto.com/migrate-a-linux-vps/ "How do you migrate a Linux VPS to a new host without losing data?") shows how to move the same set to a new server.

**Run your homeserver on a VPS paid in crypto** Kilo, Mega and Giga run Debian or Ubuntu in New York, Dallas, Los Angeles, London, Amsterdam or Frankfurt, at one price in every city. No KYC: signing up and paying take no identity document, no selfie, no card and no phone number. [See plans and prices](https://vpswithcrypto.com/pricing/ "How much does a VPS With Crypto server cost per month?")

## Questions about Synapse on a VPS

### Can I change the server name of a Synapse server later?

No. Synapse's installation guide says the server name cannot be changed after installation, because it is part of every user ID and room alias. Use delegation if you want the name `example.com` while Synapse runs on `matrix.example.com`.

### Do I have to open port 8448?

Only without delegation. Other homeservers expect your server name on 8448 by default; a `.well-known/matrix/server` file that points to port 443 lets federation share the client port, and 8448 can stay closed.

### Can I run Synapse with SQLite on a small VPS?

For a test, yes. Synapse's documentation says SQLite should not be used in production; PostgreSQL runs comfortably next to Synapse on Kilo (2 vCPU / 4 GB / 65 GB).

### Does Synapse need outgoing email?

Not to run. It needs mail for password resets, address verification and notifications. Outbound port 25 is closed on every VPS and is not opened on request; send mail through a mail provider on port 465 or 587.

### Can the host read Matrix messages stored on the server?

Messages in end-to-end encrypted rooms are stored as ciphertext; the server still holds who is in which room and when messages were sent. Unencrypted rooms sit in the database in clear. [What your VPS host can see](https://vpswithcrypto.com/what-your-vps-host-can-see/ "What can your VPS host see?") explains the layers.

## Sources

1. [Synapse installation instructions (server name, PostgreSQL, Debian packages, registering a user, TURN, RAM)](https://element-hq.github.io/synapse/latest/setup/installation.html) — Element / Synapse (read 2026-11-03)
2. [Synapse configuration manual (email, smtp_port, force_tls, max_upload_size)](https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html) — Element / Synapse (read 2026-11-03)
3. [Using a reverse proxy with Synapse (ports 443 and 8448, nginx example)](https://element-hq.github.io/synapse/latest/reverse_proxy.html) — Element / Synapse (read 2026-11-03)
4. [Delegation of incoming federation traffic (.well-known/matrix/server)](https://element-hq.github.io/synapse/latest/delegate.html) — Element / Synapse (read 2026-11-03)
5. [Using PostgreSQL with Synapse](https://element-hq.github.io/synapse/latest/postgres.html) — Element / Synapse (read 2026-11-03)
6. [Synapse releases (v1.164.2, 2 November 2026)](https://github.com/element-hq/synapse/releases) — GitHub (read 2026-11-03)
7. [Matrix.org Debian package repository (trixie, bookworm, noble, jammy)](https://packages.matrix.org/debian/dists/) — Matrix.org Foundation (read 2026-11-03)

---

VPS With Crypto: VPS With Crypto sells Linux KVM VPS in New York, Dallas, Los Angeles, London, Amsterdam and Frankfurt, paid in crypto with no ID upload. The business behind it is DomaineGoat LLC, registered in Panama. A plan costs the same in all six cities, and on a 12-month term it is priced at least 25% under a named comparable plan, chosen among 34 no-KYC crypto hosts and read on 3 November 2026.
