#set up src in server

1 messages · Page 1 of 1 (latest)

lone hollyBOT
#
Searched self-hosting Twenty docker setup installation
#
#
Searched docker compose yaml file SERVER_URL FRONTEND_URL environment variables
#

Here is how to set up Twenty on your Linux server with Docker and access it via your domain abc.net:

Quick Setup

Option 1: One-line install script (recommended)

bash <(curl -sL https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-docker/scripts/install.sh)

Option 2: Manual setup

  1. Create a working directory and download files:
mkdir twenty && cd twenty
curl -o .env https://raw.githubusercontent.com/twentyhq/twenty/refs/heads/main/packages/twenty-docker/.env.example
curl -o docker-compose.yml https://raw.githubusercontent.com/twentyhq/twenty/refs/heads/main/packages/twenty-docker/docker-compose.yml
  1. Generate a secret and update .env:
openssl rand -base64 32

Edit your .env file:

APP_SECRET=your_generated_secret_here
PG_DATABASE_PASSWORD=your_strong_password_here
  1. Configure your domain - Add this to your .env:
SERVER_URL=https://abc.net

Use http://abc.net:3000 if you do not have SSL set up yet.

  1. Start Twenty:
docker compose up -d

Domain Configuration

Since you want to access Twenty via abc.net:

  • Point your DNS - Create an A record for abc.net pointing to your server IP
  • Set up a reverse proxy (Nginx, Traefik, etc.) to forward requests to port 3000 with SSL termination
  • SSL (HTTPS) is strongly recommended for full functionality (clipboard, copy buttons, etc.)

Example Nginx config:

server {
    listen 443 ssl;
    server_name abc.net;
    
    # SSL certificates here
    
    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

After making changes, restart:

docker compose down
docker compose up -d

Then access Twenty at https://abc.net (or http://abc.net:3000 without SSL).

System requirements: At least 2GB RAM.

These pages may help:

eager urchin
#

in step 2, file .env really have :
TAG=latest

#PG_DATABASE_USER=postgres
#PG_DATABASE_PASSWORD=replace_me_with_a_strong_password_without_special_characters
#PG_DATABASE_HOST=db
#PG_DATABASE_PORT=5432
#REDIS_URL=redis://redis:6379

SERVER_URL=http://localhost:3000

Use openssl rand -base64 32 for each secret

APP_SECRET=replace_me_with_a_random_string

STORAGE_TYPE=local

STORAGE_S3_REGION=eu-west3

STORAGE_S3_NAME=my-bucket

STORAGE_S3_ENDPOINT=

lone hollyBOT
#
Searched docker compose .env configuration APP_SECRET PG_DATABASE_PASSWORD setup
#

You are correct. The .env.example file has those values commented out by default. You need to uncomment and set the required values.

Here is what your .env file should look like after editing:

TAG=latest

PG_DATABASE_USER=postgres
PG_DATABASE_PASSWORD=your_strong_password_here
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432
REDIS_URL=redis://redis:6379

SERVER_URL=https://abc.net

# Generate with: openssl rand -base64 32
APP_SECRET=your_generated_secret_here

STORAGE_TYPE=local

Key changes:

  1. Uncomment PG_DATABASE_PASSWORD and set a strong password (no special characters)
  2. Uncomment APP_SECRET and set it to the value generated by openssl rand -base64 32
  3. Change SERVER_URL from http://localhost:3000 to your domain:
    • Use https://abc.net if you have SSL configured via reverse proxy
    • Use http://abc.net:3000 if no SSL yet

After editing .env, start Twenty:

docker compose up -d

For your domain to work, you also need to:

  1. Point your DNS A record for abc.net to your server IP
  2. Set up a reverse proxy (Nginx, Traefik, etc.) to forward traffic to port 3000 with SSL termination

SSL is strongly recommended for full functionality (clipboard, copy buttons, etc.).

Let me know if you run into any issues.

eager urchin
#

root@cs-linux-20260113172059287:~/twenty# docker compose up -d
[+] up 41/41
[+] up 48/48tgres:16 Pulled 96.7s
✔ Image postgres:16 Pulled 96.7s
✔ Image redis Pulled 43.2s
✔ Image twentycrm/twenty:latest Pulled 278.4s
✔ Network twenty_default Created 0.5s
✔ Volume twenty_server-local-data Created 0.0s
✔ Volume twenty_db-data Created 0.0s
✔ Container twenty-db-1 Healthy 18.1s
✔ Container twenty-redis-1 Healthy 9.9s
✘ Container twenty-server-1 Error dependency server failed to start 124.8s
✔ Container twenty-worker-1 Created 0.5s
dependency failed to start: container twenty-server-1 is unhealthy

lone hollyBOT
#
Searched docker container unhealthy server failed to start troubleshooting
#

The server container is failing to start. Let me check the logs to understand what is happening.

First, check the server logs:

docker compose logs twenty-server-1

This will show you the specific error. Common causes for this issue:


Most likely cause: Missing or invalid APP_SECRET

Make sure you have uncommented and set APP_SECRET in your .env file:

APP_SECRET=your_generated_secret_here

Generate one with:

openssl rand -base64 32

Quick fix - try this:

  1. Stop everything and remove volumes (since this is a fresh install):
docker compose down --volumes
  1. Make sure your .env file has these values uncommented and set:
TAG=latest

PG_DATABASE_USER=postgres
PG_DATABASE_PASSWORD=your_strong_password_here
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432
REDIS_URL=redis://redis:6379

SERVER_URL=http://localhost:3000

APP_SECRET=your_generated_secret_here

STORAGE_TYPE=local
  1. Start again:
docker compose up -d
  1. Check logs:
docker compose logs

Paste the output of docker compose logs twenty-server-1 here and I can help diagnose the specific issue.

eager urchin
#

root@cs-linux-20260113172059287:~/twenty# docker compose up -d
WARN[0000] The "DISABLE_DB_MIGRATIONS" variable is not set. Defaulting to a blank string.
WARN[0000] The "STORAGE_S3_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "DISABLE_CRON_JOBS_REGISTRATION" variable is not set. Defaulting to a blank string.
WARN[0000] The "STORAGE_S3_REGION" variable is not set. Defaulting to a blank string.
WARN[0000] The "STORAGE_S3_ENDPOINT" variable is not set. Defaulting to a blank string.
WARN[0000] The "STORAGE_S3_REGION" variable is not set. Defaulting to a blank string.
WARN[0000] The "STORAGE_S3_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "STORAGE_S3_ENDPOINT" variable is not set. Defaulting to a blank string.
WARN[0000] No services to build
[+] up 7/7
✔ Network twenty_default Created 0.2s
✔ Volume twenty_server-local-data Created 0.0s
✔ Volume twenty_db-data Created 0.0s
✔ Container twenty-redis-1 Healthy 7.0s
✔ Container twenty-db-1 Healthy 8.0s
✘ Container twenty-server-1 Error dependency server failed to start 8.3s
✔ Container twenty-worker-1 Created 0.1s
dependency failed to start: container twenty-server-1 is unhealthy

lone hollyBOT
#
Searched docker server container unhealthy error troubleshooting
#

The warnings about S3 variables are fine since you are using local storage. The server container is failing its health check. Let me help you diagnose this.

Check the server logs:

docker logs twenty-server-1

Paste the output here so I can see the specific error.


Most common causes for this issue:

  1. Missing APP_SECRET - This is required and must be uncommented in your .env
  2. Database password mismatch - If you changed the password after the first run

Quick fix to try:

  1. First, check your .env file and make sure these are uncommented and set:
PG_DATABASE_USER=postgres
PG_DATABASE_PASSWORD=your_strong_password_here
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432
REDIS_URL=redis://redis:6379
APP_SECRET=your_generated_secret_here
  1. Generate APP_SECRET if you have not:
openssl rand -base64 32
  1. Since this is a fresh install, reset everything:
docker compose down --volumes
docker compose up -d
  1. Check logs again:
docker logs twenty-server-1

Let me know what the logs show.

eager urchin
#

root@cs-linux-20260113172059287:~/twenty# docker logs twenty-server-1
Running database setup and migrations...
psql: error: invalid integer value "cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA" for connection option "port"
Running database setup and migrations...
psql: error: invalid integer value "cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA" for connection option "port"
Running database setup and migrations...
psql: error: invalid integer value "cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA" for connection option "port"
Running database setup and migrations...
psql: error: invalid integer value "cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA" for connection option "port"
Running database setup and migrations...
psql: error: invalid integer value "cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA" for connection option "port"
Running database setup and migrations...
psql: error: invalid integer value "cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA" for connection option "port"
Running database setup and migrations...
psql: error: invalid integer value "cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA" for connection option "port"
Running database setup and migrations...
psql: error: invalid integer value "cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA" for connection option "port"
Running database setup and migrations...
psql: error: invalid integer value "cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA" for connection option "port"
Running database setup and migrations...
psql: error: invalid integer value "cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA" for connection option "port"

lone hollyBOT
#

Found the issue. Your APP_SECRET value (cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA) is being read as the database port. This means there is a formatting problem in your .env file.

The problem: Your .env file likely has the variables in the wrong order or PG_DATABASE_PORT is not set correctly.

Fix your .env file:

Make sure each variable is on its own line and properly set:

TAG=latest

PG_DATABASE_USER=postgres
PG_DATABASE_PASSWORD=twentypassword
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432
REDIS_URL=redis://redis:6379

SERVER_URL=http://localhost:3000

APP_SECRET=cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA

STORAGE_TYPE=local

Important checks:

  • Make sure PG_DATABASE_PORT=5432 is uncommented (remove the # at the start)
  • Make sure there are no extra spaces around the = signs
  • Make sure each variable is on its own line

After fixing .env, reset and restart:

docker compose down --volumes
docker compose up -d

Then check:

docker logs twenty-server-1

Let me know how it goes.

eager urchin
#

How i get twentypassword

lone hollyBOT
#

You create it yourself. It is just a password you choose for the PostgreSQL database.

Use any strong password you want, for example:

PG_DATABASE_PASSWORD=MySecurePassword123

Requirements:

  • Avoid special characters (no @, #, $, %, &, etc.)
  • Use letters and numbers only
  • Make it reasonably strong

Example .env file:

TAG=latest

PG_DATABASE_USER=postgres
PG_DATABASE_PASSWORD=MySecurePassword123
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432
REDIS_URL=redis://redis:6379

SERVER_URL=http://localhost:3000

APP_SECRET=cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA

STORAGE_TYPE=local

Then restart:

docker compose down --volumes
docker compose up -d

The password is only used internally between the Twenty server and the PostgreSQL database container. You will not need to enter it anywhere else.

eager urchin
#

TAG=latest

PG_DATABASE_USER=postgres
PG_DATABASE_PASSWORD=MySecurePassword123
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432
REDIS_URL=redis://redis:6379

SERVER_URL=http://crmdemo.net:3000

Generate with: openssl rand -base64 32

APP_SECRET=cG8mMEXa++x81eJQYTCf59N6QthhLsD9xRrTA/AAULQ=

STORAGE_TYPE=local

I changed this file, but when i run docker compose ulti error
✘ Container twenty-server-1 Error dependency server failed to start 116.3s

dependency failed to start: container twenty-server-1 is unhealthy

lone hollyBOT
#

The APP_SECRET contains special characters (/, +, =) which can cause issues.

Try these fixes:

  1. Generate a new APP_SECRET without special characters:
openssl rand -hex 32

This will give you a hex string with only letters and numbers.

  1. Update your .env file:
TAG=latest

PG_DATABASE_USER=postgres
PG_DATABASE_PASSWORD=MySecurePassword123
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432
REDIS_URL=redis://redis:6379

SERVER_URL=http://crmdemo.net:3000

APP_SECRET=your_new_hex_secret_here

STORAGE_TYPE=local
  1. Reset and restart:
docker compose down --volumes
docker compose up -d
  1. Check logs:
docker logs twenty-server-1

Paste the new logs if it still fails.

lone hollyBOT
#
Searched password authentication failed postgres first install troubleshooting
#

That link is correct. This is a known issue documented in the troubleshooting guide.

The problem: The password you set during the first installation attempt is stored in the database volume. When you changed the password later, the database still had the old password stored.

Since this is a fresh installation, here is the fix:

  1. Update your .env file with the password you want to use

  2. Remove the volumes and restart:

docker compose down --volumes
docker compose up -d

This will delete the old database volume (which has the old password) and create a fresh one with your new password.

  1. Check if it worked:
docker logs twenty-server-1

The --volumes flag is key here - it removes the database volume so the new password can be set properly on the fresh database.

Let me know if that resolves it.

eager urchin
#

root@cs-linux-20260113172059287:~/twenty# docker compose up -d
WARN[0000] No services to build
[+] up 3/3
✔ Container twenty-redis-1 Healthy 0.6s
✔ Container twenty-db-1 Healthy 1.1s
✔ Container twenty-server-1 Healthy 1.1s
root@cs-linux-20260113172059287:~/twenty# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8eecaa16a55a twentycrm/twenty:latest "/app/entrypoint.sh …" 19 hours ago Up About a minute twenty-worker-1
a931ab0fe180 twentycrm/twenty:latest "/app/entrypoint.sh …" 19 hours ago Up 19 hours (healthy) 0.0.0.0:3000->3000/tcp, [::]:3000->3000/tcp twenty-server-1
8932126ebbae postgres:16 "docker-entrypoint.s…" 19 hours ago Up 19 hours (healthy) 5432/tcp twenty-db-1
3ccb553f344c redis "docker-entrypoint.s…" 19 hours ago Up 19 hours (healthy) 6379/tcp twenty-redis-1

lone hollyBOT
#

Twenty is now running successfully. All containers are healthy.

Access Twenty at: http://crmdemo.net:3000

Make sure your DNS A record for crmdemo.net points to your server's IP address.

Quick test from your server:

curl http://localhost:3000

If you want to access it via https://crmdemo.net (without the port), you will need to set up a reverse proxy (Nginx, Traefik, etc.) with SSL termination. Let me know if you need help with that.

eager urchin
#

It up, but how to edit src ???

lone hollyBOT
#
Searched local development setup source code edit contribute
#

You are running Twenty via Docker using the pre-built image (twentycrm/twenty:latest). This is a production deployment, not a development setup.

If you want to edit the source code, you need to set up a local development environment instead of using Docker. Here is how:

Local Development Setup

1. Install prerequisites:

  • Git
  • Node v24.5.0 (use nvm)
  • yarn v4
# Enable yarn
corepack enable

2. Clone the repository:

git clone https://github.com/twentyhq/twenty.git
cd twenty

3. Set up PostgreSQL and Redis:

You can use your existing Docker containers for the database and Redis, or install them locally.

4. Copy environment files:

cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env

5. Install dependencies:

yarn

6. Set up the database:

npx nx database:reset twenty-server

7. Start the development servers:

npx nx start twenty-server
npx nx worker twenty-server
npx nx start twenty-front

Access points:

  • Frontend: http://localhost:3001
  • Backend: http://localhost:3000
  • GraphQL API: http://localhost:3000/graphql
  • REST API: http://localhost:3000/rest

Demo login: [email protected] / [email protected]


Important: You cannot edit the source code inside the Docker container since it uses a pre-built image. For development, you need to run Twenty from source as described above.

These pages may help:

Twenty Documentation

The guide for contributors (or curious developers) who want to run Twenty locally.

Twenty Documentation
eager urchin
#

but i want set up twenty manage src and up to server with domain

lone hollyBOT
#
#
Searched build docker image custom twenty source code
#

I understand now. You want to:

  1. Edit/develop the Twenty source code
  2. Deploy your modified version to your server
  3. Access it via your domain

The documentation does not cover building a custom Docker image from modified source code. However, here is the general approach:

Option 1: Build Your Own Docker Image (Advanced)

1. Clone the repository on your server:

git clone https://github.com/twentyhq/twenty.git
cd twenty

2. Make your code changes in the relevant packages:

  • packages/twenty-front/ - Frontend (React)
  • packages/twenty-server/ - Backend (NestJS)

3. Build your own Docker image:

cd packages/twenty-docker
docker build -t my-twenty:latest .

4. Update your docker-compose.yml to use your custom image:

# Change from:
image: twentycrm/twenty:${TAG}
# To:
image: my-twenty:latest

5. Restart:

docker compose down
docker compose up -d

Option 2: Local Development Setup (Recommended for Development)

If you want to actively develop and test changes, run Twenty from source instead of Docker:

1. Install prerequisites:

  • Node v24.5.0 (use nvm)
  • Yarn 4 (corepack enable)

2. Clone and setup:

git clone https://github.com/twentyhq/twenty.git
cd twenty
yarn

3. Configure environment files:

cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env

4. Setup database and start:

npx nx database:reset twenty-server
npx nx start twenty-server
npx nx start twenty-front

The documentation does not provide detailed instructions for building custom Docker images from source. You may want to check the GitHub repository or ask in the Twenty Discord for more specific guidance on production deployment of modified source code.

These pages may help:

Twenty Documentation

The guide for contributors (or curious developers) who want to run Twenty locally.

eager urchin
#

i have an db image in docker hub and i want use it

lone hollyBOT
#

You can use your own database image by modifying the docker-compose.yml file.

1. Open your docker-compose.yml:

nano ~/twenty/docker-compose.yml

2. Find the db service section and change the image:

db:
  image: your-dockerhub-username/your-db-image:tag
  volumes:
    - db-data:/var/lib/postgresql/data
  environment:
    POSTGRES_USER: ${PG_DATABASE_USER}
    POSTGRES_PASSWORD: ${PG_DATABASE_PASSWORD}
  healthcheck:
    test: ["CMD-SHELL", "pg_isready -U ${PG_DATABASE_USER} -d default"]
    interval: 5s
    timeout: 5s
    retries: 5
  restart: always

Replace your-dockerhub-username/your-db-image:tag with your actual Docker Hub image.

3. Update .env if needed to match your database credentials:

PG_DATABASE_USER=your_db_user
PG_DATABASE_PASSWORD=your_db_password
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432

4. Reset and restart:

docker compose down --volumes
docker compose up -d

Important: Your database image must be PostgreSQL-compatible since Twenty requires PostgreSQL. If your image has a different database name or user, make sure to update the .env file accordingly.

What is your Docker Hub image name? I can help you configure it correctly.

eager urchin
#

i go Local Development Setup and use db image in docker hub, how can i do

lone hollyBOT
#
Searched local development setup database configuration PostgreSQL
#

Here is how to set up Twenty for local development using your Docker Hub database image:

Local Development Setup with Your Docker DB Image

1. Install prerequisites:

# Install nvm if not already installed
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

# Close and reopen terminal, then:
nvm install 24.5.0
nvm use 24.5.0
corepack enable

2. Clone the repository:

git clone https://github.com/twentyhq/twenty.git
cd twenty

3. Start your Docker Hub database image:

docker run -d \
  --name twenty-postgres \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -p 5432:5432 \
  your-dockerhub-username/your-db-image:tag

Replace your-dockerhub-username/your-db-image:tag with your actual image name.

4. Start Redis via Docker:

make redis-on-docker

Or run Redis manually:

docker run -d --name twenty-redis -p 6379:6379 redis

5. Create the required databases:

docker exec -it twenty-postgres psql -U postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;"

6. Copy environment files:

cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env

7. Update ./packages/twenty-server/.env to point to your database:

PG_DATABASE_URL=postgres://postgres:postgres@localhost:5432/default
REDIS_URL=redis://localhost:6379

8. Install dependencies:

yarn

9. Set up the database and start:

npx nx database:reset twenty-server
npx nx start twenty-server
npx nx worker twenty-server
npx nx start twenty-front

Or start all at once:

npx nx start

10. Access Twenty:


What is your Docker Hub database image name? I can help you adjust the configuration if needed.

eager urchin
#

my image is vanvo13065/twenty-app20-custom and vanvo13065/twenty-db20-custom

lone hollyBOT
#

You have both a custom app image and a custom database image. Here is how to set them up:

Option 1: Docker Deployment (Production)

If you want to deploy your custom images to your server with your domain:

1. Update your docker-compose.yml:

version: '3.8'

services:
  db:
    image: vanvo13065/twenty-db20-custom
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: ${PG_DATABASE_USER}
      POSTGRES_PASSWORD: ${PG_DATABASE_PASSWORD}
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${PG_DATABASE_USER} -d default"]
      interval: 5s
      timeout: 5s
      retries: 5
    restart: always

  redis:
    image: redis
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 5s
      retries: 5
    restart: always

  server:
    image: vanvo13065/twenty-app20-custom
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy
    environment:
      PG_DATABASE_URL: postgres://${PG_DATABASE_USER}:${PG_DATABASE_PASSWORD}@${PG_DATABASE_HOST}:${PG_DATABASE_PORT}/default
      SERVER_URL: ${SERVER_URL}
      REDIS_URL: ${REDIS_URL}
      APP_SECRET: ${APP_SECRET}
      STORAGE_TYPE: ${STORAGE_TYPE}
    ports:
      - "3000:3000"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/healthz"]
      interval: 5s
      timeout: 5s
      retries: 10
    restart: always

  worker:
    image: vanvo13065/twenty-app20-custom
    depends_on:
      server:
        condition: service_healthy
    environment:
      PG_DATABASE_URL: postgres://${PG_DATABASE_USER}:${PG_DATABASE_PASSWORD}@${PG_DATABASE_HOST}:${PG_DATABASE_PORT}/default
      SERVER_URL: ${SERVER_URL}
      REDIS_URL: ${REDIS_URL}
      APP_SECRET: ${APP_SECRET}
      STORAGE_TYPE: ${STORAGE_TYPE}
    command: ["yarn", "worker:prod"]
    restart: always

volumes:
  db-data:

2. Your .env stays the same:

TAG=latest

PG_DATABASE_USER=postgres
#

PG_DATABASE_PASSWORD=MySecurePassword123
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432
REDIS_URL=redis://redis:6379

SERVER_URL=http://crmdemo.net:3000

APP_SECRET=your_hex_secret_here

STORAGE_TYPE=local


**3. Reset and start:**
```bash
docker compose down --volumes
docker compose up -d

Option 2: Local Development with Your DB Image

If you want to develop locally and edit source code:

1. Start your custom database:

docker run -d \
  --name twenty-postgres \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -p 5432:5432 \
  vanvo13065/twenty-db20-custom

2. Start Redis:

docker run -d --name twenty-redis -p 6379:6379 redis

3. Clone and setup Twenty source:

git clone https://github.com/twentyhq/twenty.git
cd twenty
yarn

4. Configure ./packages/twenty-server/.env:

PG_DATABASE_URL=postgres://postgres:postgres@localhost:5432/default
REDIS_URL=redis://localhost:6379

5. Start development servers:

npx nx database:reset twenty-server
npx nx start twenty-server
npx nx start twenty-front

Which option do you want to use? And does your vanvo13065/twenty-db20-custom image already have the Twenty database schema, or is it a fresh PostgreSQL image?

GitHub

Building a modern alternative to Salesforce, powered by the community. - twentyhq/twenty

eager urchin
#

how to down image in docker hub to docker server

lone hollyBOT
#

To pull (download) your images from Docker Hub to your server:

Pull your images:

docker pull vanvo13065/twenty-app20-custom
docker pull vanvo13065/twenty-db20-custom

Verify they are downloaded:

docker images

You should see both images listed.


If your images are private, you need to login first:

docker login

Enter your Docker Hub username (vanvo13065) and password.

Then pull the images:

docker pull vanvo13065/twenty-app20-custom
docker pull vanvo13065/twenty-db20-custom

After pulling, you can use them in your docker-compose.yml as shown in my previous message, then run:

docker compose up -d
eager urchin
#

i downladed my image to docker server it is : vanvo13065/twenty-db20-custom:v1 and vanvo13065/twenty-app20-custom:v1
Countinue Option 2: Local Development with Your DB Image

lone hollyBOT
#

Your images are downloaded. Now let's set up local development with your custom DB image.

1. Start your custom database:

docker run -d \
  --name twenty-postgres \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -p 5432:5432 \
  vanvo13065/twenty-db20-custom:v1

2. Start Redis:

docker run -d --name twenty-redis -p 6379:6379 redis

3. Verify both containers are running:

docker ps

4. Install Node.js and Yarn:

# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

# Reload terminal
source ~/.bashrc

# Install and use Node v24.5.0
nvm install 24.5.0
nvm use 24.5.0

# Enable yarn
corepack enable

5. Clone Twenty source code:

git clone https://github.com/twentyhq/twenty.git
cd twenty

6. Copy environment files:

cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env

7. Edit ./packages/twenty-server/.env:

nano ./packages/twenty-server/.env

Set these values:

PG_DATABASE_URL=postgres://postgres:postgres@localhost:5432/default
REDIS_URL=redis://localhost:6379
APP_SECRET=your_hex_secret_here

Generate APP_SECRET with:

openssl rand -hex 32

8. Install dependencies:

yarn

9. Set up database and start:

npx nx database:reset twenty-server
npx nx start twenty-server
npx nx worker twenty-server
npx nx start twenty-front

Access Twenty:

Now you can edit the source code in:

  • packages/twenty-front/ - Frontend
  • packages/twenty-server/ - Backend

Changes will hot-reload automatically.

Let me know when you complete each step or if you hit any errors.

eager urchin
#

root@cs-linux-20260113172059287:~/twenty# docker images
i Info → U In Use
IMAGE ID DISK USAGE CONTENT SIZE EXTRA
redis:latest 73dad4271642 203MB 55.4MB U
vanvo13065/twenty-app20-custom:v1 2129d75738e9 2.22GB 329MB
vanvo13065/twenty-db20-custom:v1 987b85d2b9c4 397MB 110MB U
root@cs-linux-20260113172059287:~/twenty# docker run -d
--name twenty-postgres
-e POSTGRES_USER=postgres
-e POSTGRES_PASSWORD=postgres
-p 5432:5432
vanvo13065/twenty-db20-custom:v1
docker: Error response from daemon: Conflict. The container name "/twenty-postgres" is already in use by container "095c9ee70115d0bcc91cbe9e2fac29c96a9f580f35379c70dc0afe3ee7e09b35". You have to remove (or rename) that container to be able to reuse that name.

Run 'docker run --help' for more information
root@cs-linux-20260113172059287:~/twenty# docker run -d --name twenty-redis -p 6379:6379 redis
docker: Error response from daemon: Conflict. The container name "/twenty-redis" is already in use by container "b5621a99b30830fcbeb6090d8fc585797936a02c967fb5e5a3823ba19aa15d0c". You have to remove (or rename) that container to be able to reuse that name.

Run 'docker run --help' for more information