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
More notes
- A fresh DNS record existed, but my Mac still said the domain did not
- Put a feature branch on an existing Coolify URL, then put it back
- Check the offsite copy of a Coolify compose database backup
- Two Umami first-boot checks I nearly missed on Coolify
- Choosing a VPS in Australia for self-hosting
- A launchd job that dies with no code change
- Coolify quietly bakes your build secrets into the image layers
- A full VPS disk on Coolify: 1905 MB per rebuild, down to 31 MB
- The Next.js standalone healthcheck trap on Coolify
- serve -s makes every URL on a multi-page site come back 200