Railway

Deploy Twenty — Open-Source Salesforce Alternative CRM

Self-host Twenty CRM: open-source Salesforce alternative. No per-seat fees.

Deploy Twenty — Open-Source Salesforce Alternative CRM

/var/lib/postgresql/data

Just deployed

Just deployed

/app/packages/twenty/data

Just deployed

/data

Bucket

Bucket

Just deployed

Deploy and Host Twenty CRM on Railway

Twenty is the open-source CRM built to replace Salesforce — 45k+ GitHub stars, Y Combinator S23, AGPL-3.0, and free forever when self-hosted. A modern React interface that feels like Notion, custom objects and fields with no SQL migrations, Airtable-style tables and Kanban pipelines, workflow automation, full RBAC, and a complete GraphQL + REST API where every object you create is instantly available. Built by a Paris team for technical teams that want to own their customer data instead of renting it.

A 10-person team pays ~$19,800/year for Salesforce Enterprise. HubSpot Sales Professional runs ~$100/user/month. Twenty self-hosted on Railway costs ~$10–20/month flat for the whole team — no per-seat fees, no feature gates, no data lock-in.


What This Template Deploys

ServicePurpose
Twenty ServerNestJS backend + React frontend — CRM UI, GraphQL/REST API, workflow engine, and auth on the public web service
Twenty WorkerBackground worker — email sync, scheduled workflows, and async jobs
PostgreSQL 16Primary database — companies, people, opportunities, custom objects, and all CRM data
RedisCache and job queue backing the worker and real-time features

All services connect over Railway's private network. Server and worker share the same image and APP_SECRET — this template wires them together automatically via reference variables.


About Hosting Twenty

Twenty is a production-grade CRM — React frontend, NestJS backend, PostgreSQL, and Redis — and running it means coordinating four moving parts with a shared secret, database migrations on deploy, and a public HTTPS endpoint. The official path is Docker Compose on a VPS you manage; this template does the same wiring on Railway with zero server administration.

Railway provisions the server, worker, PostgreSQL, and Redis over private networking, runs migrations automatically, and serves the app over HTTPS. Your CRM data lives in your own PostgreSQL instance — export it, migrate it, or fork the whole platform at any time.

Typical cost: ~$10–20/month on Railway's Hobby plan for the full four-service stack. Salesforce Sales Cloud Enterprise is $165/user/month; HubSpot Sales Professional is ~$100/user/month plus onboarding fees. Twenty self-hosted has no per-seat license — the cost is flat compute no matter how many people you add.


Deploy in Under 5 Minutes

  1. Click Deploy on Railway — all four services build automatically (~4–5 minutes)
  2. APP_SECRET and database credentials are auto-generated and shared across server and worker
  3. Set SERVER_URL to your Railway public domain (required for correct links and auth)
  4. Open your Railway URL and create your first workspace and admin account
  5. Import contacts via CSV or the API, or start building custom objects immediately

No Docker Compose. No migration scripts. No shared-secret wiring by hand.


Common Use Cases

  • Self-hosted alternative to Salesforce — replace $165/user/month Enterprise licensing with flat Railway compute; custom objects and RBAC that Salesforce reserves for premium tiers are included free
  • Self-hosted alternative to HubSpot — modern pipeline CRM without the ~$100/user/month Professional pricing or the onboarding fees, with your data on your own infrastructure
  • Developer-first CRM you extend as code — define objects, fields, and views with the Twenty SDK and version your CRM like the rest of your stack via the GraphQL/REST API
  • Custom CRM for non-standard data — model "Properties," "Legal Cases," "Patients," or any domain object in the Data Model UI with no SQL and no code
  • Agency multi-client CRM — stand up isolated Twenty workspaces per client with TypeScript-level customization; self-hosting makes multi-tenant setups tractable
  • Startup CRM that scales without per-seat cost — add your whole growing team at flat infrastructure cost instead of watching a per-user bill climb with headcount

Configuration

VariableRequiredDescription
APP_SECRET✅ Auto-generatedShared secret for tokens — must be identical across server and worker
SERVER_URL✅ RequiredYour Railway public domain — required for correct links and authentication
PG_DATABASE_URL✅ Auto-injectedPostgreSQL connection string via Railway reference variable
REDIS_URL✅ Auto-injectedRedis connection URI via Railway reference variable
STORAGE_TYPEPre-setlocal by default; set to s3 for external object storage of attachments
EMAIL_DRIVEROptionalsmtp to enable email sync and invitations — pair with an SMTP provider
IS_SIGN_UP_DISABLEDRecommendedSet true after creating your account to block public sign-ups
PORTAuto-setRailway injects the port automatically

APP_SECRET must match on both the server and worker services — this template shares it via a reference variable automatically. On Railway Hobby, raw SMTP is blocked, so use an HTTPS-based relay (Resend, Brevo) for email sync and workspace invitations.


Twenty vs. CRM Alternatives

Twenty (Railway)SalesforceHubSpotEspoCRM
Monthly cost~$10–20 flat$165/user~$100/userSelf-hosted
10-person team/year~$120–240~$19,800~$14,500+Self-hosted
Per-seat license✅ None❌ Yes❌ Yes✅ None
Custom objects (no code)✅ Free❌ Premium tier❌ Enterprise✅ Yes
GraphQL + REST API✅ Auto for every object⚠️ Limited⚠️ Tiered✅ REST
Modern UI✅ Notion-like⚠️ Dated✅ Good⚠️ Functional
Data ownership✅ Your PostgreSQL❌ Salesforce❌ HubSpot✅ Yes
Open source✅ AGPL-3.0❌ No❌ No✅ Yes

Dependencies for Twenty Hosting

  • Railway account — Hobby plan (~$10–20/month) covers the four-service stack
  • SMTP provider (Resend or Brevo) for email sync and invitations — raw SMTP is blocked on Hobby
  • Optional: S3-compatible storage for attachments in large deployments

Deployment Dependencies

Implementation Details

This template deploys Twenty's server and worker (same image, shared APP_SECRET) alongside PostgreSQL 16 and Redis over Railway's private network. Database migrations run automatically on deploy. The server exposes the CRM UI and the GraphQL/REST API; the worker handles email sync, scheduled workflows, and async jobs through the Redis queue.

Set SERVER_URL to your Railway public domain immediately after deploy — without it, auth callbacks and record links point to the wrong host. All CRM data persists in PostgreSQL independently of the containers, so redeploys and version updates never touch your workspace.


Frequently Asked Questions

How much does Twenty save versus Salesforce or HubSpot? A 10-person team pays roughly $19,800/year for Salesforce Sales Cloud Enterprise or ~$14,500 for HubSpot Sales Professional in year one. Twenty self-hosted on Railway costs ~$120–240/year in compute with no per-seat fees. The savings grow with every seat you add.

Is the self-hosted version feature-limited compared to Twenty Cloud? No per-seat gating — self-hosted Twenty includes the full CRM: custom objects, pipelines, workflows, RBAC, and the API, free for unlimited users. A paid Organization plan adds enterprise extras like SSO/SAML and row-level permissions; the core CRM is complete without it.

Can I migrate from Salesforce or HubSpot? Yes. Twenty imports contacts, companies, and deals via CSV or its API, with documented patterns for migrations of 50,000+ records. Platform-specific automations (Salesforce Flows, HubSpot sequences) don't transfer — you rebuild those in Twenty's workflow engine.

What are Twenty's current limitations? Reporting and forecasting are basic compared to Salesforce, the workflow engine handles standard automation but not Salesforce Flow-level complexity, and the app ecosystem is younger. For advanced automation, teams often pair Twenty with n8n or Zapier. Core CRM (contacts, companies, deals, custom objects, API) is production-stable.

Do I lose my CRM data if Railway redeploys? No. All companies, people, opportunities, custom objects, and settings live in the Railway- managed PostgreSQL database. Redeploys, updates, and restarts don't affect your workspace data.

Can AI agents work with Twenty? Yes. Twenty exposes a full GraphQL and REST API where every object and field you create is automatically available — so Claude, Cursor, or any agent can read and write CRM data programmatically. Twenty Cloud also ships a native MCP server for direct agent integration.


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 a modern open-source CRM — custom objects, pipelines, workflows, RBAC, and a full API — that replaces Salesforce at flat ~$10–20/month with no per-seat fees and complete ownership of your customer data.


Template Content

More templates in this category

View Template
Libredesk - Complete Setup
[Jul'26] Complete self-hosted omnichannel customer support desk.

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

Instatic
58
View Template
Strapi
A popular self-hosted CMS

Milo
7.6K