Self-host Twenty CRM

Open-source customer relationship management (CRM) system whose objects, views and workflows can be extended as code. Run your own Twenty CRM on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.

Updated November 23, 2026

Running your own Twenty CRM usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Twenty CRM behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.

Just ask your agent

Open a Plus workspace (Twenty CRM runs in Docker, which Plus and Pro include), tap Launch to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

Set up Twenty CRM on this workspace and give me the link. Follow https://envhaven.com/self-host/twenty.md

Then open the link it sends and create your Twenty CRM account straight away, before anyone else finds the address. That is the whole request: the address in it is this page’s Markdown copy, and the agent follows the instructions for it further down, with every setting Twenty CRM’s docs require.

Or keep it private with Tailscale

The preview URL puts Twenty CRM on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Twenty CRM an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace’s Vars pane as TS_AUTHKEY, and ask the agent:

Set up Twenty CRM on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/twenty.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
  • A Tailscale container runs beside Twenty CRM, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
  • Anything other services have to reach, such as a webhook, still needs a public address. Keep self-hosted apps private with Tailscale covers both, and what Tailscale’s free plan includes.
At a glance
What it isSites, CRM and business
LicenseAGPL-3.0 for most of the code
Runs asDocker (twentycrm/twenty)
MemoryAt least 2 GB of RAM (docs)
Plan that fitsPlus or larger
Web port3000
Documentationdocs.twenty.com/developers/self-host/capabilities/docker-compose

What your agent takes care of

  • Installing it. Twenty CRM runs from the official image, twentycrm/twenty, with its data in folders under ~/apps/twenty.
  • Putting it on an HTTPS address. The workspace’s preview URL serves it, and your own domain can too.
  • Locking it down first. What Twenty CRM’s docs say to set before it faces the internet, below.
  • Telling you what to back up: db-data volume (PostgreSQL data at /var/lib/postgresql/data), server-local-data volume (/app/packages/twenty-server/.local-storage, local file storage) and the .env file, above all ENCRYPTION_KEY (docs).

The settings it needs behind a proxy

  • SERVER_URL (.env): The public URL users type; used for generated links, OAuth callbacks and HTTPS detection for secure cookies, and must match the browser address. (docs)
  • NODE_PORT (compose environment): Port the server listens on inside the container, 3000. (docs)
  • Reverse proxy upstream and headers: Forward to port 3000, terminate SSL and pass the needed headers. (docs)
  • STORAGE_TYPE (default local): File storage backend; local uses a Docker volume, S3 settings are optional. (docs)

Before it faces the internet

  • The first user becomes admin and later sign-ups close, so create your account right after the first start. (docs)
  • Sign-ups close after the first workspace in the default single-workspace mode. (docs)
  • Keep the instance off the public internet where possible. (docs)
  • Do not expose the API paths. (docs)
  • Read the security page before exposing it. (docs)
  • Set a strong database password; the compose default is postgres. (docs)
  • Compose default database password. (docs)
  • Generate an ENCRYPTION_KEY for new installs. (docs)

Things to ask next

Everything after the install is one more sentence to the agent. Some that come up:

  • “Set the site’s name, logo and colors from the files I dropped into the workspace.”
  • “Create my first admin user and a second one with fewer rights.”
  • “Move Twenty CRM to app.example.com.” Add the domain on the dashboard’s Domains page with a CNAME to domains.envhaven.app, and the agent changes Twenty CRM’s address settings to match.
  • “Update Twenty CRM to the latest release.” It pulls the new image and recreates the container, data kept.

Instructions for the agent

The agent reads these from the page’s Markdown copy. They also work pasted on their own, if you would rather give them in your own words.

Set up Twenty CRM on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, twentycrm/twenty, starting from the docs' compose file: https://github.com/twentyhq/twenty/blob/main/packages/twenty-docker/docker-compose.yml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: worker (same image, runs yarn worker:prod); PostgreSQL 16; Redis.
- Keep the compose file in ~/apps/twenty and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Twenty CRM's port 3000.
- The preview URL terminates HTTPS in front of Twenty CRM: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/twenty.md for the preview URL, as Twenty CRM's docs describe for running behind a proxy; skip any that apply only when Twenty CRM serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/twenty.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Twenty CRM up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.

What to know

  • In Docker, Twenty CRM’s containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
  • The docs treat the CRM as private by default; only /webhooks, /s and /emailing are meant to be public, and the Cloudflare route needs no open ports. (docs)
  • Hosted automation tools cannot reach a private instance. (docs)
  • HTTPS is needed for some browser features such as the clipboard API. (docs)
  • Too little memory makes processes crash. (docs)
  • Docs offer Cloudflare Tunnel with Access as a documented exposure option. (docs)
  • A stateless host needs external storage. (docs)
  • A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.

Without a workspace

The manual route, on a server you run:

  1. Rent a Linux VPS, secure SSH, and create a user for the app.
  2. Install Docker and write a compose file from the official image.
  3. Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
  4. Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
  5. Keep the firewall closed except for the proxy, and schedule backups and updates.

Twenty CRM’s own documentation covers each step for its install methods.

Sources

Facts about Twenty CRM come from its own documentation, checked on 2026-11-23: