Deploying a Twenty App
Introduction
Twenty is an open-source CRM with a modern React front end and a Node.js/GraphQL backend. This guide shows how to containerize Twenty, connect it to PostgreSQL (and optionally Redis), persist uploads, and deploy it to Klutch.sh over HTTP.
Prerequisites
- GitHub repository containing your Dockerfile.
- PostgreSQL database (managed or deployed separately).
- Optional Redis instance for caching and queueing.
- Klutch.sh project ready in klutch.sh/app.
Project structure
.└── DockerfileSample Dockerfile
FROM twentycrm/twenty:latest
# Default app portENV PORT=3000EXPOSE 3000Required environment variables
DATABASE_URL– PostgreSQL connection string, e.g.,postgres://USER:PASSWORD@HOST:PORT/DBAPP_URL– public URL, e.g.,https://example-app.klutch.shJWT_SECRET– strong secret for auth tokensSESSION_SECRET– strong secret for session cookies
Optional environment variables
REDIS_URL– if using Redis for caching/queues.PORT– override internal port if you change it.NODE_ENV=production
Persistence
If you store file uploads locally, attach a volume:
- Mount path:
/app/storage - Size: based on expected attachment growth
Networking
- Protocol: HTTP
- Internal port:
3000 - Users reach
https://example-app.klutch.shwhile Klutch.sh routes to port3000in the container.
Health check (recommended)
curl -I http://localhost:3000Deployment on Klutch.sh
- Push your Dockerfile to GitHub.
- In klutch.sh/app, create a new app and choose GitHub as the source.
- Klutch.sh automatically detects the Dockerfile in the repository root.
- Select HTTP traffic and set the internal port to
3000. - Add environment variables for
DATABASE_URL,APP_URL,JWT_SECRET,SESSION_SECRET, and any Redis configuration. Mark secrets as sensitive. - Optionally attach a persistent volume at
/app/storageif storing uploads locally. - Deploy. After the app starts, create your initial workspace and user in the UI.
Verification
-
UI: open
https://example-app.klutch.shand confirm the onboarding screen loads. -
Quick API check (if applicable):
Terminal window curl -I https://example-app.klutch.sh
Next steps
- Enforce strong secrets and rotate them periodically.
- Enable database backups for PostgreSQL.
- Configure Redis and object storage if you expect heavy usage or large attachments.