---
title: "Deploy Element Web"
description: "Element Web v1.12.35 with its own Synapse homeserver and Postgres"
category: "Other"
url: https://railway.com/deploy/element-web-1
---

# Deploy Element Web

Element Web v1.12.35 with its own Synapse homeserver and Postgres

**[Deploy Element Web on Railway](https://railway.com/template/element-web-1)**

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

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

## Template content

### Element Web https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/element.png

- **Source:** https://github.com/aalfath/element-web-railway-template
- **Health check:** /version
- **Public domain:** Yes

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

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

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

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

## Documentation

# Deploy and Host Element Web on Railway

Element Web is the browser version of Element, the Matrix chat client: rooms, direct messages, threads, file sharing, voice and video calls, with end-to-end encryption. This template deploys it together with its own Matrix homeserver (Synapse) and PostgreSQL, so your accounts and messages live on your server, not on matrix.org.

## About Hosting Element Web

Element Web is a static web app. To be useful it needs a Matrix homeserver for accounts, rooms and message history, and that homeserver needs a database and somewhere to keep its signing key and uploaded files. This template runs three services: Element Web v1.12.35, Synapse v1.165.0 and Railway's PostgreSQL. Both apps use official images, pinned by version and digest. Element's `config.json` is written at start, so the login page already points at your Synapse. Synapse generates its keys and secrets and creates an admin account with a generated password. Sign-up is closed by default. Nothing needs to be filled in at deploy time.

## Common Use Cases

* A private Slack or Discord alternative for a team, family or community, with your data on your own server
* An end-to-end encrypted chat that you control and that can still talk to the wider Matrix network
* A web client and homeserver to put Matrix bridges and bots (Slack, Discord, Telegram, IRC) behind

## Dependencies for Element Web Hosting

* A Matrix homeserver: Synapse is included, with its signing key, secrets and media on a volume
* PostgreSQL: Railway's Postgres service is included, with a volume

### Deployment Dependencies

* Element Web source and releases: https://github.com/element-hq/element-web/releases
* Element Web configuration: https://github.com/element-hq/element-web/blob/develop/docs/config.md
* Synapse configuration manual: https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html
* Template repo (Dockerfiles, start scripts, changelog): https://github.com/aalfath/element-web-railway-template

### Implementation Details

The template deploys these services:

* **Element Web** (public): nginx serves the Element bundle with the security headers that Element recommends. The health check is `/version`.
* **Synapse** (public): the Matrix homeserver. Element in your browser talks to it directly, so it needs its own domain. It serves the Matrix well-known files itself, so federation works over HTTPS without a proxy. Keys, secrets and media are on the `/data` volume. The health check is `/health`.
* **Postgres**: stores accounts, rooms and messages. Synapse creates its own `synapse` database with the C locale it needs.

After deploy:

1. Open the Element Web service's URL. The login page shows your Synapse domain as the homeserver.
2. Sign in as `admin` with `SYNAPSE_ADMIN_PASSWORD` from the Synapse service's Variables tab.
3. Add people in one of two ways:
   * set `SYNAPSE_ENABLE_REGISTRATION=true` on Synapse and hand out registration tokens; or
   * create the accounts with Synapse's admin API.

**Server name.** `SYNAPSE_SERVER_NAME` is the `:domain` part of every user ID, and it can't change after the first start. To use your own domain, add it to Synapse and set `SYNAPSE_SERVER_NAME` and `SYNAPSE_PUBLIC_BASEURL` before you create accounts.

**Options.** On Element Web:

* `ELEMENT_BRAND` renames the app.
* `ELEMENT_DISABLE_CUSTOM_URLS=true` hides the homeserver picker.
* `ELEMENT_CONFIG_JSON` merges any other Element setting into `config.json`.

On Synapse, put SMTP, single sign-on (OIDC) or TURN settings in a YAML file under `/data/conf.d/`.

**Updates.** Both app services build from the template's GitHub repo. When we bump the pinned Element or Synapse version there, Railway shows an "update available" notice in your project, and you choose when to apply it. Read `CHANGELOG.md` in the repo first.

## Why Deploy Element Web 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 Element Web 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/element-web-1
