Fix a failing healthcheck blocking the deploy on Coolify

Error: Healthcheck failed / Container is unhealthy — new container never receives traffic, deploy rolls back to the old container (or shows 404 "No available server")

Coolify's healthcheck never reports the new container healthy, so Traefik won't route to it and the deploy stalls or rolls back, surfacing a 404 / "No available server".

Coolify runs the healthcheck inside the container using curl or wget — the official docs state the container must have one of them installed. The check fails when (a) the base image ships neither curl nor wget (common on alpine/slim/distroless/scratch, and on multi-stage builds that install them only in the build stage), (b) the configured port or path doesn't match a route the app actually answers with a 2xx, or (c) the app binds to a different interface than the check targets. Until the check passes, Traefik won't send traffic and Coolify keeps the old container live or rolls back.

The fix

  1. Open Configuration > Healthchecks and confirm the Path and expected response code match a route your app actually answers with 2xx (e.g. path /, code 200). A wrong path returns a non-2xx status and the check fails.

  2. Make sure the container's runtime stage has curl or wget — the Coolify docs require one of them for healthchecks. Slim/alpine/distroless images often ship neither, and multi-stage builds drop them if they're only added in the build stage.

    # Debian/Ubuntu base
    RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
    # Alpine base
    RUN apk add --no-cache wget
  3. Add a lightweight health route if your app has no cheap 200 endpoint, then point the healthcheck Path at it.

    // e.g. Express
    app.get('/health', (_req, res) => res.sendStatus(200))
  4. For Dockerfile / Docker Compose deploys, define the healthcheck in the Dockerfile or compose file — per the docs it takes precedence over the UI settings. wget is often more reliable than curl in minimal images.

    HEALTHCHECK --interval=10s --timeout=5s --retries=5 \
      CMD wget -qO- http://127.0.0.1:3000/health || exit 1
  5. If you just need it live now (a one-off job, or a container with no shell tools and no HTTP route), toggle the healthcheck off under Configuration > Healthchecks, redeploy, then re-enable once you've added curl/wget and a proper check.

Verify it worked

Coolify marks the container Healthy and the deploy completes/swaps in the new container; docker inspect reports health status healthy.

docker inspect --format '{{.State.Health.Status}}' <container-name>

Related Coolify errors

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

All Coolify deploy errors