Twenty CRM Self-Hosted Docker Compose Production Deployment
Twenty CRM is the leading open-source modern alternative to HubSpot, built on TypeScript and PostgreSQL. Self-hosting requires deploying three containers via Docker Compose: the Twenty server image (twentycrm/twenty:latest), PostgreSQL 16 with UUID extensions, and Redis for background job queues. A single \$20/month VPS comfortably supports up to 25 sales representatives.
Production Docker Compose Blueprint
services:
twenty-server:
image: twentycrm/twenty:latest
restart: always
ports:
- "3000:3000"
environment:
- PORT=3000
- PG_DATABASE_URL=postgres://twenty:secretpassword@twenty-db:5432/twenty
- REDIS_URL=redis://twenty-redis:6379
- SIGNING_KEY=generate_with_openssl_rand_hex_32
- SERVER_URL=https://crm.yourdomain.com
depends_on:
twenty-db:
condition: service_healthy
twenty-db:
image: postgres:16-alpine
restart: always
volumes:
- twenty_db_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=twenty
- POSTGRES_PASSWORD=secretpassword
- POSTGRES_DB=twenty
healthcheck:
test: ["CMD-SHELL", "pg_isready -U twenty"]
interval: 5s
timeout: 5s
retries: 5
volumes:
twenty_db_data:
Check our migration guides and comparisons: Twenty CRM vs HubSpot Audit and ERPNext vs Salesforce Migration.