# Docker compose POSTGRES & NOCODB

**URL:** <https://community.nocodb.com/t/docker-compose-postgres-nocodb/1697>\
**Category:** Self-Host\
**Created:** [March 5, 2025, 12:26pm UTC](https://community.nocodb.com/t/docker-compose-postgres-nocodb/1697 "2025-03-05T12:26:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrolsonDev](https://avatars.discourse-cdn.com/v4/letter/f/6a8cbe/32.png) [@FrolsonDev](https://community.nocodb.com/u/FrolsonDev)\
**Post date:** [March 5, 2025, 12:26pm UTC](https://community.nocodb.com/t/docker-compose-postgres-nocodb/1697/1 "2025-03-05T12:26:15Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![mertmit](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mertmit](https://community.nocodb.com/u/mertmit)\
**Post date:** [March 5, 2025, 12:30pm UTC](https://community.nocodb.com/t/docker-compose-postgres-nocodb/1697/2 "2025-03-05T12:30:35Z")

</div>

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](https://docs.nocodb.com/getting-started/self-hosted/environment-variables) for details.

Note: Also make sure nocodb & postgres-db are in same docker network if they are not in same docker-compose file.

---

<div class="post-metadata">

**Author:** ![FrolsonDev](https://avatars.discourse-cdn.com/v4/letter/f/6a8cbe/32.png) [@FrolsonDev](https://community.nocodb.com/u/FrolsonDev)\
**Post date:** [March 5, 2025, 4:15pm UTC](https://community.nocodb.com/t/docker-compose-postgres-nocodb/1697/3 "2025-03-05T16:15:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mertmit](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mertmit](https://community.nocodb.com/u/mertmit)\
**Post date:** [March 5, 2025, 9:33pm UTC](https://community.nocodb.com/t/docker-compose-postgres-nocodb/1697/4 "2025-03-05T21:33:45Z")

</div>

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 !!
