Deploy Twenty CRM

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

Deploy Twenty CRM

Just deployed

/app/packages/twenty/data

Just deployed

/data

Just deployed

/var/lib/postgresql/data

Bucket

Bucket

Just deployed

Deploy and Host Twenty on Railway

Twenty logo

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

ServicePurpose
TwentyWeb app, GraphQL and REST APIs, and database migrations, served on port 3000.
Twenty WorkerBackground jobs over BullMQ: mailbox and calendar sync, workflow runs, imports and scheduled tasks.
PostgresPostgreSQL 18 (SSL). The CRM's records, metadata and custom objects.
RedisRedis 8.2, password-protected, with a persistent volume. Queue and cache.
BucketRailway 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

VariableRequiredDescription
APP_SECRET🔐 Auto-generatedSession signing and encryption key. Referenced by the worker.
SERVER_URL✅ Auto-setPublic HTTPS URL from the Twenty service domain.
PG_DATABASE_URL✅ Auto-injectedPostgres connection over the private network.
REDIS_URL✅ Auto-injectedRedis connection for the job queue, with IPv6 family support.
STORAGE_TYPE✅ Sets3 (Railway Bucket). Use local to store files on the Twenty volume.
STORAGE_S3_*✅ Auto-injectedBucket name, region, endpoint, access key and secret key from the Railway Bucket.
STORAGE_LOCAL_PATH✅ Setdata, used only when STORAGE_TYPE is local.
DISABLE_DB_MIGRATIONS✅ SetServer false, worker true.
DISABLE_CRON_JOBS_REGISTRATION✅ SetServer false, worker true.
NODE_PORT, PORT✅ Set3000.
ENABLE_ALPINE_PRIVATE_NETWORKING✅ Settrue, 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 RailwayTwenty CloudHubSpot CRMPipedrive
Pricing~$15–25/month, flat$9–39 per user/monthFree tier, then per seatPer 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

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.


Template Content

More templates in this category

View Template
Libredesk - Complete Setup
Complete self-hosted omnichannel customer support desk.

codestorm
2
View Template
Paperless-ngx
Paperless-ngx — document management with OCR and full-text search

INAPP
1
View Template
Instatic CMS - Postgres
Design, build and manage powerful static sites from state-of-the-art CMS

Instatic
168