Deploy Twenty CRM API

Self-hosted Twenty CRM with REST, GraphQL and webhooks

Deploy Twenty CRM API

Just deployed

Just deployed

/app/packages/twenty-server/.local-storage

Just deployed

/data

/var/lib/postgresql/data

Deploy and Host Twenty CRM API (Open-Source CRM) on Railway

This Railway template runs self-hosted Twenty with its generated REST and GraphQL APIs plus webhooks. Create a custom object like Invoice and it immediately exposes the same endpoints as People or Companies.

About Hosting Twenty CRM API on Railway (self hosted Twenty template)

Self-hosting Twenty on Railway means your CRM data, uploaded files and API logs stay on infrastructure you control. You get the full open-source CRM without babysitting VPS packages or database backups.

Why Deploy Twenty CRM API on Railway (Railway Free Trial)

Twenty gives you the API-driven CRM without Salesforce's per-user licensing. Your schema generates REST and GraphQL endpoints immediately, so a custom Invoice object works like People or Companies. Deploy on Railway with the $5 trial, then keep the stack around ten to twenty-five dollars monthly for a small team.

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 API 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.

Railway vs Other Hosting Providers and VPS for Twenty CRM API self hosting

Railway bundles the Twenty API, worker, Postgres, and Redis into one deploy so you do not have to wire those services together.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanOne template, managed Postgres and Redis.A raw VPS you patch and back up yourself.
AWSNo IAM or VPC setup.ECS, RDS, and ElastiCache with more config.
HetznerNo server provisioning, logs and variables built in.A cheaper VPS you run with Docker Compose.

Railway removes the infrastructure steps.

Common Use Cases for hosted Twenty CRM API

  • Sync Stripe invoices to custom objects: Add an Invoice object in Settings, then have your billing script post charges to /rest and link them to People or Companies as charges close.
  • Power a customer portal: Give your portal's backend an API key with a limited role and call /graphql so users can edit their own contact fields without seeing internal pipeline data.
  • Alert sales on key events: Subscribe to company.updated and person.created webhooks, verify X-Twenty-Webhook-Signature, then post changes to your sales Slack.
  • Migrate from a legacy CRM: Use REST batch endpoints to push up to 60 records per request, mapping old tables to standard or custom objects as you leave the old system.

Dependencies for Twenty Docker hosted on Railway

Twenty on Railway runs four services: server (port 3000, /healthz, file volume), worker (same image, /app/entrypoint.sh yarn worker:prod), Postgres 16, and Redis 8.2 for queue and cache. Postgres and Redis each use a persistent volume. The worker handles webhooks, workflows, email and calendar syncs.

Deployment Dependencies for Managed Twenty Service (Open-Source CRM)

Server sets DISABLE_DB_MIGRATIONS=false and DISABLE_CRON_JOBS_REGISTRATION=false; worker sets both true. Set SERVER_URL, generated APP_SECRET and ENCRYPTION_KEY, PG_DATABASE_URL, REDIS_URL, STORAGE_TYPE=local for file storage. Never rotate APP_SECRET after data exists.

Implementation Details for Twenty (Using the official Twenty v2.48.0 image)

The official image runs both server and worker. The server mounts the file volume at /app/packages/twenty-server/.local-storage. Open your domain and sign up; first user creates the workspace. To switch to S3, set STORAGE_TYPE=s3 and S3 vars. Keep the worker running for webhooks. This keeps API and webhook traffic reliable.

How does Twenty compare against other CRMs

Twenty vs Salesforce (Salesforce Alternative)

  • License: Twenty is AGPL-3.0 open source and self-hosted; Salesforce is proprietary with per-user fees.

  • Data control: Twenty keeps records on your own Postgres and file volume; Salesforce holds data in its cloud.

  • Customization: Both support custom objects, but Twenty's metadata API creates them programmatically without a consultant.

  • Where Salesforce wins: enterprise ecosystem, advanced reporting, and managed integrations.

Twenty vs HubSpot (HubSpot Alternative)

  • Cost model: Self-hosting Twenty is free beyond infrastructure; HubSpot's paid hubs get expensive per seat.

  • CRM scope: Twenty focuses on core CRM, custom objects, and workflows; HubSpot bundles marketing, sales, and service.

  • Where HubSpot wins: native marketing automation, email sequences, and templates.

Twenty vs Pipedrive (Pipedrive Alternative)

  • UI philosophy: Twenty uses Notion-like flexible views and kanban; Pipedrive is pipeline-first.

  • Self hosting: Twenty runs on your own Docker stack with Postgres and Redis; Pipedrive is SaaS only.

  • Where Pipedrive wins: simpler onboarding for pure sales teams and mobile apps.

Twenty vs Odoo (Odoo Alternative)

  • Open source model: Twenty is AGPL-3.0 focused on CRM; Odoo is open-core ERP with paid enterprise modules.

  • Architecture: Twenty separates server, worker, Postgres, and Redis; Odoo is a monolithic Python/Postgres app.

  • Where Odoo wins: accounting, inventory, and manufacturing modules.

How to use Twenty CRM API (the OSS Open-Source CRM)?

  1. Create an API key in Settings, then Developers, APIs and Webhooks. Copy the key once; assign a role to limit its access.
  2. Open your workspace API docs and interactive playground in Settings to see generated endpoints for People, Companies and any custom objects like Invoice.
  3. Send requests to /rest/ or /graphql on your Railway domain with the header Authorization: Bearer your-key.
  4. Try a metadata call to /rest/metadata or /metadata to create an object or field without leaving your app.
  5. For bulk work, batch create, update or delete up to 60 records per request. Use fields= to trim responses and filters like name[eq]:Acme.

How to self host Twenty on other VPS Services (Twenty self hosting guide)

Clone the Repository

Run git clone https://github.com/twentyhq/twenty.git and cd twenty/packages/twenty-docker. This contains the official compose files.

Install Dependencies

Install Docker and Docker Compose, then copy .env.example to .env in that directory. No other runtime installs are needed because the compose file runs Postgres, Redis and Twenty.

Configure Environment Variables

Set SERVER_URL=https://your-domain, a random ENCRYPTION_KEY, and PG_DATABASE_PASSWORD; the compose file builds PG_DATABASE_URL and REDIS_URL for its own db and redis containers. Keep STORAGE_TYPE=local. For S3, set STORAGE_TYPE=s3 plus S3 vars. Keep secrets unchanged after first run.

Start the Twenty Application

Run docker compose up -d. The server migrates the database on start. Open your-domain, sign up as the first user and you own the workspace. Railway handles this whole stack for you with one template deploy.

Official Pricing of Twenty (Twenty pricing)

Twenty is open source under AGPL-3.0, so self-hosting the CRM, REST and GraphQL APIs, webhooks, and workflows is free. Custom objects like Invoice get the same endpoints at no extra license cost. For self-hosted API work, your cost is hosting, not licenses.

Twenty cloud vs self hosted comparison (Pricing, features, costs, and more)

Self hosting Twenty keeps the CRM source and your data on your own infrastructure, while Twenty Cloud removes operational work but charges per user. You get the same REST and GraphQL APIs either way, but self hosting gives you direct control over keys, webhooks, and worker scaling.

Monthly cost of self hosting Twenty on Railway

The software itself is free, but you pay for Railway resources. Expect roughly $10-25 per month for the server, worker, Postgres, and Redis at small-team use. Railway's $5 trial credit covers early testing. Twenty Cloud uses paid per-user plans, which can exceed that quickly as the team grows.

System Requirements for Hosting Twenty on a VPS

Upstream recommends at least 2 GB of RAM for reliable operation. You also need Postgres 16 and Redis 8.2, plus disk space for database volumes and uploaded files. The twenty-worker service runs background jobs like webhooks and workflows, so keep it running alongside the main app.

Frequently Asked Questions (FAQs)

Does the API cover custom objects I create in Twenty?

Yes. Twenty generates REST and GraphQL endpoints from your workspace schema, so a new Invoice object gets the same record operations as People or Companies without extra wiring.

Where do I find my workspace-specific API docs?

After you create an API key in Settings, Developers, the interactive playground and API docs appear for your workspace. Copy the key immediately because Twenty shows it only once.

Can I batch create or update records?

REST supports up to 60 records per request, and GraphQL supports batch upserts plus relation traversal in one query. Send Authorization: Bearer followed by your key on every call.

Are webhook deliveries signed?

Twenty POSTs JSON for record created, updated and deleted events. Each request includes X-Twenty-Webhook-Signature, an HMAC SHA256 over timestamp:payload, plus X-Twenty-Webhook-Timestamp so you can verify the sender.

What runs workflows and webhooks on Railway?

The twenty-worker service delivers webhooks and runs background jobs, cron jobs and workflows. Keep that service running, or event-driven integrations will stop firing.

Do I need migrations enabled on the server service?

Keep DISABLE_DB_MIGRATIONS=false on the server so it applies schema changes on start. The worker sets it true because migrations should run once, not twice.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
49
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51