Skip to Content

Deploy Twenty

A modern open-source CRM alternative to Salesforce and Pipedrive.

⭐ 15.0k stars📜 AGPL-3.0🔴 Advanced⏱ ~20 minutes

What You’ll Get

A fully working Twenty instance running on your server. Your data stays on your hardware — no third-party access, no usage limits, no surprise invoices.

Prerequisites

  • A server with Docker and Docker Compose installed (setup guide)
  • A domain name pointed to your server (optional but recommended)
  • Basic terminal access (SSH)

The Config

Create a directory for Twenty and add this docker-compose.yml:

# ------------------------------------------------------------------------- # 🚀 Created and distributed by The AltStack # 🌍 https://thealtstack.com # ------------------------------------------------------------------------- version: '3.8' services: twenty: image: twentyhq/twenty:latest container_name: twenty restart: unless-stopped depends_on: - db ports: - "3000:3000" environment: - PG_DATABASE_URL=postgres://twenty:twenty@db:5432/twenty - FRONTEND_URL=http://localhost:3000 db: image: postgres:15-alpine container_name: twenty-db restart: unless-stopped environment: - POSTGRES_USER=twenty - POSTGRES_PASSWORD=twenty - POSTGRES_DB=twenty volumes: - twenty_db_data:/var/lib/postgresql/data volumes: twenty_db_data:

Let’s Ship It

# Create a directory mkdir -p /opt/twenty && cd /opt/twenty # Create the docker-compose.yml (paste the config above) nano docker-compose.yml # Pull images and start docker compose up -d # Watch the logs docker compose logs -f

Environment Variables

VariableDefaultRequired
PG_DATABASE_URLpostgres://twenty:twenty@db:5432/twentyNo
FRONTEND_URLhttp://localhost:3000No
POSTGRES_USERtwentyNo
POSTGRES_PASSWORDtwentyNo
POSTGRES_DBtwentyNo

Post-Deployment Checklist

  • Service is accessible on the configured port
  • Admin account created (if applicable)
  • Reverse proxy configured (Caddy guide)
  • SSL/HTTPS working
  • Backup script set up (backup guide)
  • Uptime monitor added (Uptime Kuma)

The “I Broke It” Section

Container won’t start?

docker compose logs twenty | tail -50

Port already in use?

# Find what's using the port lsof -i :PORT_NUMBER

Need to start fresh?

docker compose down -v # ⚠️ This deletes volumes/data! docker compose up -d

Going Further