---
title: "Deploy Twenty CRM"
description: "Open-source Twenty CRM with worker, Postgres, Redis and file storage."
category: "CMS"
url: https://railway.com/deploy/twenty-crm-open-source
---

# Deploy Twenty CRM

Open-source Twenty CRM with worker, Postgres, Redis and file storage.

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

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/twenty-crm-open-source/manifest.json

- **Creator:** SB
- **Category:** CMS

## Template content

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

- **Image:** twentycrm/twenty:latest

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

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

- **Image:** twentycrm/twenty:latest

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

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

## Buckets

- **Bucket**

## Documentation

# Deploy and Host Twenty on Railway

![Twenty logo](https://cdn.jsdelivr.net/gh/selfhst/icons/png/twenty.png)

Twenty is the open-source CRM that more than **60,000 developers have starred on GitHub**. It looks and feels like a modern productivity app: a fast table and Kanban interface for companies, people and opportunities, custom objects and fields, workflows, email and calendar sync, and an API for everything. This template deploys the full production layout Twenty recommends, with a server, a separate background worker, PostgreSQL, Redis and S3-compatible file storage on a Railway Bucket. Everything is connected and configured, so you open your domain and create a workspace. Hosted CRMs bill per user. Here you pay about $15–25/month for the infrastructure and add as many users as you like.

---

## What This Template Deploys

| Service | Purpose |
|---|---|
| **Twenty** | Web app, GraphQL and REST APIs, and database migrations, served on port `3000`. |
| **Twenty Worker** | Background jobs over BullMQ: mailbox and calendar sync, workflow runs, imports and scheduled tasks. |
| **Postgres** | PostgreSQL 18 (SSL). The CRM's records, metadata and custom objects. |
| **Redis** | Redis 8.2, password-protected, with a persistent volume. Queue and cache. |
| **Bucket** | Railway Bucket for uploaded files, avatars and attachments through Twenty's S3 driver. |

Both Twenty processes run the same image. They read one shared secret and one set of storage settings, so the configuration lives in a single place on the server and the worker follows it.

---

## About Hosting Twenty

Running Twenty yourself is straightforward once the moving parts are in place. The tricky part is that it fails quietly when they aren't.

**Two processes, one image.** The `twentycrm/twenty` image runs either the server or the worker. The server handles the UI and APIs, applies migrations and registers cron jobs. The worker processes the queue. This template sets `DISABLE_DB_MIGRATIONS` and `DISABLE_CRON_JOBS_REGISTRATION` to `true` on the worker, so only one process changes the schema or schedules jobs.

**A queue that actually drains.** Redis carries every background job. Without a worker reading from it, imports, syncs and workflows pile up and never finish. Both are included and wired over Railway's private network.

**Matching secrets and URLs.** `APP_SECRET` is generated once on the server and referenced by the worker. `SERVER_URL` is built from the Twenty public domain. A mismatch in either causes failed logins or a sign-in redirect loop.

**Uploads that persist.** Files go to the Railway Bucket by default, so they survive redeploys and don't fill a container disk. A volume is also attached to the Twenty service if you switch `STORAGE_TYPE` to `local`.

Typical cost: **~$15–25/month** on Railway for a small team, mostly RAM for the server and worker (about 0.5 GB each at idle). Twenty's core is AGPL-3.0, with some enterprise-only features under a commercial licence.

---

## Deploy Twenty in Under 5 Minutes

1. Click **Deploy on Railway**. The five pieces provision and connect in roughly 3–5 minutes.
2. In the **Twenty** service, go to **Settings** and then **Networking**. Confirm there is a public domain targeting port `3000`, generate one if not, and redeploy so `SERVER_URL` uses it.
3. Visit the domain and complete the setup screen to create your workspace and admin login.
4. Bring in data: CSV import for companies and people, or the API for anything scripted.
5. Customise objects, fields and views, then invite teammates by email.

No seat counting. No per-record pricing. Your CRM, your database.

---

## Common Use Cases

- **Own your customer data.** Keep contacts, deals and history in a Postgres database you control.
- **Developer-first CRM.** Query and update everything through GraphQL or REST, and generate typed clients.
- **Sales pipeline for small teams.** Kanban deal stages, tasks, notes and email threads on every record.
- **Recruiting and partnerships.** Custom objects for candidates, partners or suppliers, each with its own views.
- **CRM inside your product stack.** Sync users and accounts from your app's database or billing system.
- **Automations.** Workflows that react to record changes, run on a schedule or call external webhooks.
- **Customer success tracking.** Log calls, meetings and renewals per account so nothing slips through.
- **Escape per-seat pricing.** Give the whole company CRM access without growing the bill.

---

## Configuration

| Variable | Required | Description |
|---|---|---|
| `APP_SECRET` | 🔐 Auto-generated | Session signing and encryption key. Referenced by the worker. |
| `SERVER_URL` | ✅ Auto-set | Public HTTPS URL from the Twenty service domain. |
| `PG_DATABASE_URL` | ✅ Auto-injected | Postgres connection over the private network. |
| `REDIS_URL` | ✅ Auto-injected | Redis connection for the job queue, with IPv6 family support. |
| `STORAGE_TYPE` | ✅ Set | `s3` (Railway Bucket). Use `local` to store files on the Twenty volume. |
| `STORAGE_S3_*` | ✅ Auto-injected | Bucket name, region, endpoint, access key and secret key from the Railway Bucket. |
| `STORAGE_LOCAL_PATH` | ✅ Set | `data`, used only when `STORAGE_TYPE` is `local`. |
| `DISABLE_DB_MIGRATIONS` | ✅ Set | Server `false`, worker `true`. |
| `DISABLE_CRON_JOBS_REGISTRATION` | ✅ Set | Server `false`, worker `true`. |
| `NODE_PORT`, `PORT` | ✅ Set | `3000`. |
| `ENABLE_ALPINE_PRIVATE_NETWORKING` | ✅ Set | `true`, for Railway's private network. |

**Connecting mailboxes and calendars.** Add the Google or Microsoft OAuth variables from Twenty's self-hosting docs to both Twenty services, then redeploy them together.

**Outgoing email.** Add Twenty's email driver and SMTP variables to send invites and notifications.

**Talking to Twenty from other Railway services.** Create an API key in Twenty's settings, then call the GraphQL or REST endpoint from your other services. Webhooks can push record changes back to your app, so the CRM stays in sync with your product data.

---

## Twenty vs. Alternatives

| | Twenty on Railway | Twenty Cloud | HubSpot CRM | Pipedrive |
|---|---|---|---|---|
| **Pricing** | ~$15–25/month, flat | $9–39 per user/month | Free tier, then per seat | Per user/month |
| **Self-hosted** | ✅ Yes | ❌ No | ❌ No | ❌ No |
| **Unlimited users** | ✅ Yes | ❌ Per user | ⚠️ Paid seats for features | ❌ Per user |
| **Custom objects** | ✅ Yes | ✅ Yes | ⚠️ Enterprise tier | ⚠️ Custom fields |
| **GraphQL API** | ✅ Yes | ✅ Yes | ❌ REST only | ❌ REST only |
| **Data in your own Postgres** | ✅ Yes | ❌ Hosted | ❌ Hosted | ❌ Hosted |
| **License** | ✅ AGPL-3.0 core | ✅ AGPL-3.0 core, hosted | ❌ Proprietary | ❌ Proprietary |

---

## Dependencies for Twenty Hosting

- Railway account. Hobby fits a small team; Pro gives headroom for larger datasets and more sync jobs.
- A public domain on the Twenty service.
- Optional: Google Workspace or Microsoft 365 OAuth credentials, and an SMTP provider.

### Deployment Dependencies

- [Twenty on GitHub](https://github.com/twentyhq/twenty): code, releases and issues
- [Twenty Self-Hosting Guide](https://twenty.com/developers/section/self-hosting): setup and variables
- [Twenty Docker Hub image](https://hub.docker.com/r/twentycrm/twenty): available tags
- [Railway Storage Buckets](https://docs.railway.com/guides/storage-buckets): the S3-compatible bucket

### Implementation Details

Server and worker both use `twentycrm/twenty:latest`. The worker's secret, URL and storage settings are references to the server's variables, so you edit them once. Redis runs with a password and saves to its volume every 60 seconds when keys change. Postgres stores data on its own volume, with a TCP proxy for the Railway Data panel.

Because the tag is `latest`, a redeploy may pull a newer Twenty release with new migrations. For predictable upgrades, back up Postgres first, or pin both services to a release tag such as `v2.55.0`.

---

## Frequently Asked Questions

**Is Twenty open source?**
Yes. Most of Twenty is AGPL-3.0, and some packages are MIT. A small set of enterprise files uses a commercial licence, so those features need a paid plan.

**What does it cost to run on Railway?**
Roughly $15–25/month for the server, worker, Postgres, Redis and bucket at small-team usage. There are no per-user fees, unlike Twenty Cloud at $9–39 per user per month.

**Why do I need a separate worker service?**
Twenty runs syncs, imports, workflows and scheduled jobs in a worker that reads from Redis. Without it, the UI works but background tasks never complete.

**I'm stuck in a login redirect loop. What's wrong?**
`SERVER_URL` must match the exact URL you open. Check that the Twenty service has a public domain on port 3000, use that address, and redeploy after any domain change.

**Where are my uploaded files stored?**
In the Railway Bucket, through Twenty's S3 driver. Set `STORAGE_TYPE` to `local` if you'd rather keep them on the Twenty service volume.

**How do I update to a newer Twenty version?**
Back up Postgres, then redeploy the server and worker together so both run the same release. The server applies any new migrations when it starts.

---

## Why Deploy and Host Twenty 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 on Railway, you get the full open-source CRM stack, already wired together, with flat infrastructure pricing and your data in your own database.


## Similar templates

- [Libredesk - Complete Setup](https://railway.com/deploy/libredesk-complete-setup) — Complete self-hosted omnichannel customer support desk.
- [Paperless-ngx](https://railway.com/deploy/paperless-ngx-3) — Paperless-ngx — document management with OCR and full-text search
- [Instatic CMS - Postgres](https://railway.com/deploy/instatic-cms-postgres) — Design, build and manage powerful static sites from state-of-the-art CMS

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