Fix SERVICE_FQDN / COOLIFY_URL Magic Variables Empty on Coolify

Error: SERVICE_FQDN is empty / COOLIFY_URL is wrong or blank inside the container

Coolify's magic environment variables (SERVICE_FQDN_*, COOLIFY_URL) come out empty or stale inside the container instead of resolving to your app's real domain.

Coolify's magic variables (SERVICE_FQDN_*, COOLIFY_URL) are generated at deploy time from the service name plus its domain configuration, not read from a static value. Three things commonly break that generation: a dash in the service name gets mis-split when Coolify derives the variable name from it; the generic, non-port-suffixed form of a magic variable doesn't regenerate automatically after you change the app's domain later, so it keeps serving the old value; and Compose-from-Git resources only support these magic variables from Coolify v4.0.0-beta.411 onwards, so they're silently unavailable on older versions.

The fix

  1. Confirm the Coolify version is v4.0.0-beta.411 or newer if you're deploying Compose from Git — magic variables aren't supported there on older releases.

  2. Avoid dashes in service names that magic variables reference; use underscores instead, since dashes get mis-split when Coolify derives the variable name.

  3. After changing a domain, switch to the port-specific variant (SERVICE_FQDN_<service>_<port>) instead of the generic one — the generic form doesn't regenerate on its own.

  4. Fully redeploy the app (not just restart it) to force the magic variables to regenerate.

Verify it worked

Inside the running container, the variable matches the app's actual assigned domain rather than being empty or stale.

docker exec -it <container-name> env | grep SERVICE_FQDN

Related Coolify errors

Sources

Have Emsden Studio fix it for you — from A$149

All Coolify deploy errors