Help Tweny to Portainer (port 3000 already use by other container)

Hi everyone, I’m trying to deploy Twenty CRM using Portainer, but I’m running into an issue. I already have another service using port 3000, so I’ve changed the configurations (including the exposed ports in the docker-compose.yml file), but it’s still not working as expected. Does anyone have experience with this or know what I might be missing? Any help would be greatly appreciated! Thanks in advance for your support! Just to clarify, I’m using the Docker Compose file provided in your installation documentation, and I’ve configured all the required environment variables in the .env file. I’ve double-checked everything, but the issue persists even after changing the ports.
5 Replies
!InkArium
!InkAriumOP5w ago
Log always :

Failed to deploy a stack: Network twenty_default Creating Network twenty_default Created Container twenty-change-vol-ownership-1 Creating Container twenty-db-1 Creating Container twenty-redis-1 Creating Container twenty-redis-1 Created Container twenty-change-vol-ownership-1 Created Container twenty-db-1 Created Container twenty-server-1 Creating Container twenty-server-1 Created Container twenty-worker-1 Creating Container twenty-worker-1 Created Container twenty-change-vol-ownership-1 Starting Container twenty-redis-1 Starting Container twenty-db-1 Starting Container twenty-redis-1 Started Container twenty-change-vol-ownership-1 Started Container twenty-db-1 Started Container twenty-change-vol-ownership-1 Waiting Container twenty-db-1 Waiting Container twenty-change-vol-ownership-1 Exited Container twenty-db-1 Healthy Container twenty-server-1 Starting Container twenty-server-1 Started Container twenty-server-1 Waiting Container twenty-db-1 Waiting Container twenty-db-1 Healthy Container twenty-server-1 Error dependency failed to start: container twenty-server-1 is unhealthy

Failed to deploy a stack: Network twenty_default Creating Network twenty_default Created Container twenty-change-vol-ownership-1 Creating Container twenty-db-1 Creating Container twenty-redis-1 Creating Container twenty-redis-1 Created Container twenty-change-vol-ownership-1 Created Container twenty-db-1 Created Container twenty-server-1 Creating Container twenty-server-1 Created Container twenty-worker-1 Creating Container twenty-worker-1 Created Container twenty-change-vol-ownership-1 Starting Container twenty-redis-1 Starting Container twenty-db-1 Starting Container twenty-redis-1 Started Container twenty-change-vol-ownership-1 Started Container twenty-db-1 Started Container twenty-change-vol-ownership-1 Waiting Container twenty-db-1 Waiting Container twenty-change-vol-ownership-1 Exited Container twenty-db-1 Healthy Container twenty-server-1 Starting Container twenty-server-1 Started Container twenty-server-1 Waiting Container twenty-db-1 Waiting Container twenty-db-1 Healthy Container twenty-server-1 Error dependency failed to start: container twenty-server-1 is unhealthy
and i change :
volumes:
- server-local-data:/app/packages/twenty-server/${STORAGE_LOCAL_PATH:-.local-storage}
- docker-data:/app/docker-data
ports:
- "3001:3000"
environment:
PORT: 3000
PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-twenty}@${PG_DATABASE_HOST:-db:5432}/default
volumes:
- server-local-data:/app/packages/twenty-server/${STORAGE_LOCAL_PATH:-.local-storage}
- docker-data:/app/docker-data
ports:
- "3001:3000"
environment:
PORT: 3000
PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-twenty}@${PG_DATABASE_HOST:-db:5432}/default
i already try fix by myself 3 h but nothing work any idea? I see that there are a lot of variables, what should I add to my .env if I change the server port? my actual env
TAG=latest
PGUSER_SUPERUSER=twenty_admin
PGPASSWORD_SUPERUSER=m...5
PG_DATABASE_HOST=db:5432
REDIS_URL=redis://redis:6379
SERVER_URL=http://localhost:3001
FRONT_BASE_URL=http://localhost:3001
REACT_APP_SERVER_BASE_URL=http://localhost:3001
APP_SECRET=5Z......Y=
SIGN_IN_PREFILLED=true
STORAGE_TYPE=s3
STORAGE_S3_REGION=weur
STORAGE_S3_NAME=twenty-s3
STORAGE_S3_ENDPOINT=https://d......1e.r2.cloudflarestorage.com/twenty-s3
API_RATE_LIMITING_TTL=100
API_RATE_LIMITING_LIMIT=200
TAG=latest
PGUSER_SUPERUSER=twenty_admin
PGPASSWORD_SUPERUSER=m...5
PG_DATABASE_HOST=db:5432
REDIS_URL=redis://redis:6379
SERVER_URL=http://localhost:3001
FRONT_BASE_URL=http://localhost:3001
REACT_APP_SERVER_BASE_URL=http://localhost:3001
APP_SECRET=5Z......Y=
SIGN_IN_PREFILLED=true
STORAGE_TYPE=s3
STORAGE_S3_REGION=weur
STORAGE_S3_NAME=twenty-s3
STORAGE_S3_ENDPOINT=https://d......1e.r2.cloudflarestorage.com/twenty-s3
API_RATE_LIMITING_TTL=100
API_RATE_LIMITING_LIMIT=200
I delete amm healthy check for debug and so for exemple on the db continer postgress user dosent exist ok i cant set password, i can but your image dosent use it in good way : psql: error: connection to server at "db" (172.18.0.3), port 5432 failed: FATAL: password authentication failed for user "postgres" connection to server at "db" (172.18.0.3), port 5432 failed: FATAL: password authentication failed for user "postgres" i see that on the server container : touch: /app/docker-data/db_status: Permission denied i don't know why without healthcheck work and i can"t connect to the appliucation i just need help when somone want install twenty CRM on env with other container use port 3000 it is impossible for the moment use it nin this case
!InkArium
!InkAriumOP5w ago
Ok i change my Container use 3000 to 3003 because i saw on your doc you use two port : localhost:3000 localhost:3001 But now i have
No description
!InkArium
!InkAriumOP5w ago
I hadn't yet configured the server's url so that I could go to it via an external ip. On the other hand, the documentation gives no indication when you want to use a port other than 3000, so it's really very complicated in this case. I couldn't figure it out
martmull
martmull4w ago
It seems that you try to set server port from 3000 to 3001, but 3001 is used by twenty-front app setting server to port 3003 should work. have you check https://twenty.com/developers/section/self-hosting/docker-compose#configuration and https://twenty.com/developers/section/self-hosting/self-hosting-var#backend ? Keep me posted if you encounter any other issue
!InkArium
!InkAriumOP4w ago
Thank you for pointing this out. I believe I’ve already tried setting the server to port 3003, but I’ll give it another attempt to be sure. I’ll also revisit the links you provided to double-check my configuration. I’ll keep you posted if I encounter any further issues.
Want results from more Discord servers?
Add your server