Hello there,
I am quite newbie with Docker compose but I tried for hours without finding a solution to the connextion between my container postgres 14.4 and the container nocodb -postgres
Whatever my test I always get an [ExceptionHandler] Error: Meta database configuration missing database name
Here the code for nocodb
nocodb:
image: nocodb/nocodb:latest
container_name: nocodb-postgres
ports:
- “8080:8080”
volumes:
- ./nocodb:/usr/app/data/
environment:
NC_DB: “pg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres-db:5432/${POSTGRES_DB}”
NC_AUTH_JWT_SECRET: “${NC_AUTH_JWT_SECRET}”
networks:
- app-network
depends_on:
postgres-db:
condition: service_healthy
restart: unless-stopped
I have a .env file recognized with
POSTGRES_USER=admin
POSTGRES_PASSWORD=****
POSTGRES_DB=myproject
NC_AUTH_JWT_SECRET= ****
I am on ubuntu.
Thank you for your help!
Hi @FrolsonDev
Your NC_DB format is not following our format.
Try following please:
pg://postgres-db:5432?u=${POSTGRES_USER}&p=${POSTGRES_PASSWORD}&d=${POSTGRES_DB}”
You can check our documentation for details.
Note: Also make sure nocodb & postgres-db are in same docker network if they are not in same docker-compose file.
Hello Mermit,
Thank you for your reply,
Indeed but now i have an error:
[Nest] 8 - 03/05/2025, 4:10:59 PM ERROR [ExceptionHandler] error: password authentication failed for user “admin”
I have this configuration in my docker compose:
postgres-db:
image: postgres:17.4
container_name: postgres-db
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- app-network
healthcheck:
test: [“CMD-SHELL”, “pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}”]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
nocodb:
image: nocodb/nocodb:latest
container_name: nocodb-postgres
ports:
- “8080:8080”
volumes:
- ./nocodb:/usr/app/data/
environment:
NC_DB: “pg://postgres-db:5432?u=${POSTGRES_USER}&p=${POSTGRES_PASSWORD}&d=${POSTGRES_DB}”
NC_AUTH_JWT_SECRET: “${NC_AUTH_JWT_SECRET}”
networks:
- app-network
depends_on:
postgres-db:
condition: service_healthy
restart: unless-stopped
networks:
app-network:
driver: bridge
Many thanks for your help
This looks like related to your postgres setup.
Most likely you’ve changed POSTGRES_PASSWORD after initial setup and as you are using a volume mount it is not applied.
Please make sure your credentials are working (maybe use psql and connect) and it should work for you.
Note: if your postgres instance is a fresh one you can consider removing volume which will wipe all data (including user credentials) so they will use the env variables !! be cautious as this might lead data loss !!