---
title: "Deploy Synapse"
description: "Synapse 1.165 Matrix homeserver: pinned, Postgres, keys on a volume"
category: "Other"
url: https://railway.com/deploy/synapse-1
---

# Deploy Synapse

Synapse 1.165 Matrix homeserver: pinned, Postgres, keys on a volume

**[Deploy Synapse on Railway](https://railway.com/template/synapse-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/synapse-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Other

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### Synapse https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/synapse.png

- **Source:** https://github.com/aalfath/synapse-railway-template
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Synapse on Railway

Synapse is the Matrix homeserver developed by Element. It stores your users, rooms and message history, serves Matrix clients such as Element, Cinny and FluffyChat, and federates with other Matrix servers. You keep your accounts and data on your own server, and your users can still talk to anyone else on the Matrix network.

## About Hosting Synapse

This template runs Synapse v1.165.0 from the official image, pinned by version and digest, with Railway PostgreSQL. It needs no prompts. On first start it creates a `synapse` database with the C locale that Synapse requires. It also generates the signing key and the server secrets and stores them on the `/data` volume, next to the uploaded media. It creates an `admin` account with a generated password, which you can read in the Synapse service's Variables tab. Your Railway domain becomes the server name. Synapse serves `/.well-known/matrix/server` itself, so federation works over HTTPS port 443 without a reverse proxy. Sign-up is closed by default.

## Common Use Cases

* Private, end-to-end encrypted chat for a team, family or community, with the data on your own server
* A Matrix server for your own domain that federates with matrix.org and other homeservers
* A base for Matrix bridges and bots (Slack, Discord, Telegram, IRC) that you run yourself

## Dependencies for Synapse Hosting

* PostgreSQL (included: Railway's Postgres service, with a volume)
* A Matrix client to sign in, such as Element at app.element.io (Synapse has no web interface of its own)

### Deployment Dependencies

* Synapse source and releases: https://github.com/element-hq/synapse/releases
* Configuration manual: https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html
* Template repo (Dockerfile, start script, changelog): https://github.com/aalfath/synapse-railway-template

### Implementation Details

After deploy:

1. Open `https://YOUR-DOMAIN/health`. It answers `OK`.
2. In Element (or another Matrix client), choose "Edit" next to the homeserver, enter `https://YOUR-DOMAIN`, and sign in as `admin` with the `SYNAPSE_ADMIN_PASSWORD` from the Synapse service's Variables tab.
3. Add users with the admin API. Or set `SYNAPSE_ENABLE_REGISTRATION=true`: sign-up then still needs a registration token that you create with the admin API.
4. Check federation at federationtester.matrix.org.

**Server name.** `SYNAPSE_SERVER_NAME` is the `:domain` part of every user ID, and Synapse can't change it after the first start. To use your own domain, add it to the service and set both `SYNAPSE_SERVER_NAME` and `SYNAPSE_PUBLIC_BASEURL` before you create accounts. If they don't match the volume, the start script refuses to start rather than corrupt your data.

**Configuration.** `homeserver.yaml` is rewritten from the variables on every start, so a changed variable takes effect on the next deploy. Put any other setting (SMTP, OIDC login, TURN, URL previews) in a YAML file under `/data/conf.d/`.

**Updates.** The Synapse service builds from the template's GitHub repo. When we bump the pinned Synapse version there, Railway shows an "update available" notice in your project, and you choose when to apply it. Read `CHANGELOG.md` first. Synapse migrates its database on start.

## Why Deploy Synapse on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Synapse on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.



## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — Self-hosted virtual tabletop for role-playing games (license required)
- [Double Commander in your browser](https://railway.com/deploy/double-commander-in-your-browser) — The Double Commander file manager in the cloud, from any device

Open this page in a browser: https://railway.com/deploy/synapse-1
