This guide explains how to:
- Run Twenty (frontend + backend) locally for development.
- Build, push, and deploy a custom backend image to your existing AKS cluster after changing UI or server code.
The Vars we need:
- Repo:
github.com/your-org/twenty(forked) - Registry: Docker Hub user
zeeshanhs. - Azure Postgres server:
twentypsql.postgres.database.azure.com, DBtwenty2. - AKS already running a
twenty-serverDeployment.
Adjust names where needed.
- Node.js 24.x (use
nvm). - Yarn (classic or Berry).
- Docker Desktop (or any Docker engine).
- Access to:
- Your Twenty fork.
- Azure Postgres (
twentypsql/twenty2). - AKS cluster (
kubectlcontext configured). - Docker Hub account
zeeshanhs(or your actual username).
# Clone your fork
git clone git@github.com:your-org/twenty.git
cd twenty
# Use Node 24
nvm use 24
# Install dependencies
yarn installCopy example env files:
cp packages/twenty-front/.env.example packages/twenty-front/.env
cp packages/twenty-server/.env.example packages/twenty-server/.envEdit packages/twenty-server/.env and set the DB URL. For dev you can use the same Azure DB (just be aware you’re touching the “real” DB):
PG_DATABASE_URL=postgresql://twentyadmin:YOUR_PASSWORD@twentypsql.postgres.database.azure.com:5432/twenty2?sslmode=requireOptionally also set:
DATABASE_URL=${PG_DATABASE_URL}If twenty2 is fresh and you need core tables and seed data:
# From repo root
export PG_DATABASE_URL='postgresql://twentyadmin:YOUR_PASSWORD@twentypsql.postgres.database.azure.com:5432/twenty2?sslmode=require'
export DATABASE_URL="$PG_DATABASE_URL"
# Reset + migrations
yarn nx run twenty-server:database:reset
yarn database:migrate:prodThis creates the core schema, workspace schemas, and all Twenty tables.
In one terminal (backend):
cd twenty
nvm use 24
yarn nx run twenty-server:startIn another terminal (frontend):
cd twenty
nvm use 24
yarn nx run twenty-front:startBy default (check docs / env):
- Backend:
http://localhost:3000 - Frontend:
http://localhost:3001
Use this setup while editing UI and server code; changes will hot‑reload.
After you’re happy with your changes locally, build a new Docker image and push it to your registry.
For Docker Hub user zeeshanhs, use:
export IMAGE_NAME=zeeshanhs/twenty-server:v0.1.0zeeshanhs– your Docker Hub username.twenty-server– repo name in Docker Hub.v0.1.0– any tag you like (feature-x,2025-12-15, etc.), all lowercase, no spaces.
From the repo root:
cd twenty
docker build \
-f packages/twenty-docker/Dockerfile \
-t "$IMAGE_NAME" .This Dockerfile builds the server (and usually bundles the frontend build) from your fork.
docker login # enters Docker Hub credentials for user `zeeshanhs`
docker push "$IMAGE_NAME"You should see the image appear at:
https://hub.docker.com/r/zeeshanhs/twenty-server/tags
Assume you already have a Deployment file (for example k8s/twenty-server-deploy.yaml) that currently uses the official image.
Edit your Deployment YAML:
apiVersion: apps/v1
kind: Deployment
metadata:
name: twenty-server
spec:
replicas: 1
selector:
matchLabels:
app: twenty-server
template:
metadata:
labels:
app: twenty-server
spec:
containers:
- name: twenty-server
image: zeeshanhs/twenty-server:v0.1.0 # ← your custom image
env:
- name: PG_DATABASE_URL
value: "postgresql://twentyadmin:YOUR_PASSWORD@twentypsql.postgres.database.azure.com:5432/twenty2?sslmode=require"
- name: DATABASE_URL
value: "postgresql://twentyadmin:YOUR_PASSWORD@twentypsql.postgres.database.azure.com:5432/twenty2?sslmode=require"
# …other environment variables (SERVER_URL, etc.)# Apply the updated manifest
kubectl apply -f k8s/twenty-server-deploy.yaml
# Restart pods to force pull the new image (optional but explicit)
kubectl delete pod -l app=twenty-server
# Watch status
kubectl get pods -l app=twenty-server
kubectl logs -l app=twenty-server --tail=80Once the pod is Running and logs look healthy, your public endpoint
(e.g. http://20.50.189.151 or your custom domain) serves the new code.
- Pull latest from your fork’s main branch.
- Create feature branch:
git checkout -b feature/new-ui. - Develop locally:
yarn nx run twenty-server:startyarn nx run twenty-front:start
- Build and push image:
export IMAGE_NAME=zeeshanhs/twenty-server:feature-new-ui-1 docker build -f packages/twenty-docker/Dockerfile -t "$IMAGE_NAME" . docker push "$IMAGE_NAME"
- Update AKS Deployment
image:to this tag and apply. - Verify:
kubectl logs -l app=twenty-server --tail=80- Open the app in browser and test the new UI / behavior.