# Matrix Synapse

> Your own Matrix homeserver for encrypted chat, from matrix.org's packages with PostgreSQL.

We add matrix.org's package repository, download matrix-synapse-py3 and create a PostgreSQL database with the C collation Synapse requires. `vps9-https matrix.example.com` names the server, installs and configures Synapse (PostgreSQL, registration off), creates an admin with a generated password in /root/matrix-admin.txt, and serves the Matrix APIs and .well-known files on 443 through Caddy.

## Details

- Installs on: Ubuntu and Debian
- Smallest plan: Standard (2 vCPU, 4 GB RAM)
- Public ports: 80/tcp, 443/tcp
- Project site: https://element-hq.github.io/synapse/

## After the server is ready

1. Choose the server's name: it's in every user ID (@you:matrix.example.com) and can never change. Point that domain at the server and allow ports 80 and 443 in the panel firewall.
2. Run `vps9-https matrix.example.com`. Synapse starts, Caddy gets a certificate, and your admin login (@admin:matrix.example.com) is written to /root/matrix-admin.txt.
3. Sign in with Element or another Matrix app, with https://matrix.example.com as the homeserver.
4. Add people with `register_new_matrix_user -c /etc/matrix-synapse/conf.d/vps9.yaml http://127.0.0.1:8008`; open registration stays off.

## Questions

### Can my user IDs use my main domain?

Our `vps9-https` names the server after the domain it serves, so IDs end in that domain (@you:matrix.example.com). To have @you:example.com while Synapse runs on a subdomain, the server name must be example.com and that domain must serve Matrix's .well-known files, as Synapse's delegation guide describes. Decide before the first start: the name can't change later.

### Why only Ubuntu and Debian?

matrix.org publishes Synapse packages for Debian and Ubuntu only, and they are the install Synapse's guide recommends there. On AlmaLinux, Rocky Linux and Fedora, Synapse would be installed with pip or Docker, which this app doesn't do.

### Synapse or a lighter server such as Conduit?

Synapse is the reference implementation, the most complete and the best documented, at the cost of more memory. Conduit and continuwuity use far less memory but are younger, change quickly and don't claim to be production-ready. For a server you depend on, we suggest Synapse.

## Order it

Pick Matrix Synapse in the order form, or use `"app": "synapse"` in the API or `vps9 servers create --app synapse`. See [all one-click apps](https://vpsnine.com/apps) and [plans](https://vpsnine.com/plans).
