---
title: "Deploy Twenty CRM Production"
description: "Open-source Salesforce alternative: CRM with worker, S3 files, workflows"
category: "Other"
url: https://railway.com/deploy/twenty-crm-production
---

# Deploy Twenty CRM Production

Open-source Salesforce alternative: CRM with worker, S3 files, workflows

**[Deploy Twenty CRM Production on Railway](https://railway.com/template/twenty-crm-production)**

- **Creator:** Two Workspaces
- **Category:** Other
- **Total deploys:** 10

## Template content

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

- **Source:** https://github.com/nomideusz/twenty-railway

### worker https://raw.githubusercontent.com/twentyhq/twenty/6fd8dab55243cda291fa45f896caaa9d5e5160b8/packages/twenty-chrome-extension/public/logo/32-32.svg

- **Source:** https://github.com/nomideusz/twenty-railway

### redis https://devicons.railway.app/i/redis.svg

- **Source:** https://github.com/nomideusz/twenty-railway

### server https://raw.githubusercontent.com/twentyhq/twenty/6fd8dab55243cda291fa45f896caaa9d5e5160b8/packages/twenty-chrome-extension/public/logo/32-32.svg

- **Source:** https://github.com/nomideusz/twenty-railway
- **Health check:** /healthz
- **Public domain:** Yes

## Buckets

- **twenty-storage**

## Documentation

# Deploy and Host Twenty CRM on Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/twenty-crm-production?utm_medium=integration&utm_source=button&utm_campaign=twenty)

[Twenty](https://twenty.com/) is the open-source CRM: pipelines, contacts, companies, notes, tasks, email sync, and workflow automation in a fast modern UI — a self-hosted alternative to Salesforce and Pipedrive, built by one of the most active open-source teams (50K+ GitHub stars).

## About Hosting Twenty CRM

This template runs Twenty v2 as four Railway services: the server (API + web app, runs migrations and cron registration on boot), a dedicated BullMQ worker (emails, imports, workflow runs — kept off the request path), PostgreSQL 16, and Redis tuned with `noeviction` as upstream requires for its queues. File attachments go to a **Railway bucket over S3** — Twenty's storage driver checks the specific bucket with `headBucket`, which works cleanly with Railway's bucket-scoped credentials, and it also solves the shared-volume problem (upstream's compose shares a local-storage volume between server and worker, which Railway services can't do). The Redis URL carries `?family=0` for Railway's IPv6-only private networking. First boot migrates the database in a minute or two; then create your workspace at the server's domain.

## Common Use Cases

- Sales CRM: pipelines, deals, contacts and companies with a spreadsheet-fast UI
- Replacing Salesforce/Pipedrive seats with a self-hosted CRM your data stays on
- Pair with a Chatwoot deployment for the full self-hosted customer stack: CRM + support desk

## Dependencies for Twenty CRM Hosting

- All bundled: PostgreSQL 16, Redis 7, and a Railway bucket for file attachments
- SMTP credentials (optional, post-deploy) for email notifications; Google/Microsoft OAuth apps (optional) for email and calendar sync

### Deployment Dependencies

- [Twenty self-hosting documentation](https://twenty.com/developers/section/self-hosting)
- [Template source on GitHub](https://github.com/nomideusz/twenty-railway)

### Implementation Details

**Your Twenty URL is the `server` service's domain.** First visit creates your workspace and admin user.

Service map:

| Service | Image | Role |
|---|---|---|
| server | `twentycrm/twenty:v2.20.0` | API + web app, public domain, healthcheck `/healthz`, runs migrations |
| worker | `twentycrm/twenty:v2.20.0` (CMD `yarn worker:prod`) | BullMQ jobs: emails, imports, workflows |
| postgres | `postgres:16-alpine` | Database (`default`), on a volume |
| redis | `redis:7-alpine` | BullMQ queues (`noeviction`, append-only, on a volume) |

Variable wiring (lives in the template composer; documented here for maintenance):

- **Shared by server / worker**: `PG_DATABASE_URL=postgres://postgres:${{postgres.POSTGRES_PASSWORD}}@${{postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/default`, `REDIS_URL=redis://:${{redis.REDIS_PASSWORD}}@${{redis.RAILWAY_PRIVATE_DOMAIN}}:6379?family=0` (the `family=0` suffix is required — ioredis defaults to IPv4 and Railway private DNS is IPv6-only), `SERVER_URL=https://${{server.RAILWAY_PUBLIC_DOMAIN}}`, `APP_SECRET` (generated on server, referenced by worker — must match), `STORAGE_S3_NAME=${{twenty-storage.BUCKET}}`, `STORAGE_S3_ENDPOINT=${{twenty-storage.ENDPOINT}}`, `STORAGE_S3_ACCESS_KEY_ID=${{twenty-storage.ACCESS_KEY_ID}}`, `STORAGE_S3_SECRET_ACCESS_KEY=${{twenty-storage.SECRET_ACCESS_KEY}}`
- **server**: `PORT=3000` (explicit service variable — Railway injects `PORT=8080` over image ENV)
- **postgres**: `POSTGRES_PASSWORD` (generated); volume at `/var/lib/postgresql/data`
- **redis**: `REDIS_PASSWORD` (generated); volume at `/data`

Notes and limits:

- Email/calendar sync (Gmail, Microsoft) needs your own OAuth app credentials — add the `MESSAGING_PROVIDER_*` / `AUTH_GOOGLE_*` / `AUTH_MICROSOFT_*` variables per Twenty's docs.
- Without SMTP variables, invitation and notification emails are skipped; the app works fully otherwise.
- Scale the `worker` replicas if imports or workflow executions queue up.
- Upgrade by bumping the image tag in both `server` and `worker` — migrations run automatically on the server.

## Why Deploy Twenty CRM 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 Twenty CRM 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) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/twenty-crm-production
