Self-hosting on Railway
Chelsea runs well on Railway. You set it up by hand once: there is no one-click template. You need a Railway account and a copy of the Chelsea repository on GitHub that Railway can read.
What you create
Section titled “What you create”One Railway project with:
| Piece | What it is |
|---|---|
| Postgres | A Postgres database with the pgvector extension available. Migrations also enable pg_trgm and unaccent. |
| Bucket | Railway’s S3-compatible storage, or any other S3 server, for uploaded files. |
| Redis (optional) | A cache. Chelsea runs without it. |
| web | The app people open. Built from the repository’s Dockerfile. |
| worker | Runs background jobs: emails, automations, renewals, imports. Built from the same Dockerfile. |
Both services use the one image the Dockerfile builds. The command decides what each runs: docker-entrypoint.sh web, docker-entrypoint.sh worker or docker-entrypoint.sh migrate.
Set up the web service
Section titled “Set up the web service”- Add a service from your GitHub repository and name it
web. - Make sure it builds with the
Dockerfileat the repository root. - Set the start command to
/usr/local/bin/docker-entrypoint.sh web. - Set the pre-deploy command to
/usr/local/bin/docker-entrypoint.sh migrate. It applies database migrations, syncs permissions and creates the storage bucket before each release. - Set the health check path to
/healthz. - Give it a public domain, and set
APP_URLto that address.
Set up the worker
Section titled “Set up the worker”- Add a second service from the same repository and name it
worker. - Same
Dockerfile, with the start command/usr/local/bin/docker-entrypoint.sh worker. - Set the health check path to
/healthz, with a timeout of more than 15 minutes. After a release, the worker waits up to 15 minutes for the web service to finish its migrations, and reports itself unhealthy until then so Railway keeps the previous worker running. - Give it no pre-deploy command. Only
webmigrates.
Settings for both services
Section titled “Settings for both services”Every server setting goes on both services: the worker reads the same ones, and a worker missing one fails to start. Railway’s shared variables make this easier.
| Setting | Value |
|---|---|
APP_URL |
The web service’s public address. |
DATABASE_URL |
Your Postgres connection address. |
MIGRATE_DATABASE_URL |
The direct Postgres address, on port 5432. If DATABASE_URL goes through a connection pooler such as PgBouncer, this one must not. |
SESSION_SECRET |
At least 32 random characters. |
ENCRYPTION_KEY |
64 hex characters (openssl rand -hex 32). Keep a copy safe. |
ENDPOINT, BUCKET, ACCESS_KEY_ID, SECRET_ACCESS_KEY, REGION |
Your bucket’s S3 details. Add FORCE_PATH_STYLE=true if your storage needs it, and PUBLIC_ENDPOINT if browsers reach it at another address. |
EMAIL_FROM and RESEND_API_KEY (or SMTP settings) |
Email. Required for invitations and password resets. |
REDIS_URL |
Only if you added Redis. |
See Configuration for the rest.
First start
Section titled “First start”Once both services are up, open the web service’s address. The first visit shows the setup page where you name your organization and create the owner account. Do it right away: the page disappears once that account exists.
Chelsea is operated by Arepa Labs LLC