2026-10-18

Point your app at a Coolify Postgres by container name, not IP

The database container IP can change on restart. The service name is the useful address inside the Docker network.

In my Coolify setup, a managed Postgres container sat on the coolify Docker network. An app on that same network could reach it by the database container name, which was the service UUID. The container IP could change after a restart, so I put the name in the app's DATABASE_URL instead of copying the IP.

Check the network before changing the URL

Replace the placeholder with your database container name. This read-only inspect command prints the Docker networks attached to that container:

docker inspect <db-container-name> --format '{{range $name, $network := .NetworkSettings.Networks}}{{$name}}{{end}}'

Topics

Still stuck? Send it to Emsden Studio and get a straight answer on what it is and what fixing it costs.

More notes

All notes