Sometimes Coolify Can Be a Pain (Even If It's a Great Tool)
2025-05-15Coolify is an awesome open-source PaaS that helps you deploy and manage your apps with minimal fuss. It supports Docker, GitHub integrations, automatic TLS via Caddy, and works well for most workloads out of the box.
But when something breaks at the proxy layer, debugging it can be incredibly frustrating — especially when everything looks fine.
The Problem: Container Healthy, App Inaccessible
Recently I deployed a service through Coolify that showed up as "healthy" in the UI, passed all the healthchecks, and the container logs looked totally clean.
But when I visited the assigned domain (with HTTPS enabled via Coolify), I got… nothing. Just a connection error.
- The domain was resolving correctly.
- SSL was set up.
- The healthcheck was working.
- Logs looked fine.
So why wasn’t the app accessible?
The Root Cause: Port Not Exposed in Dockerfile
After a frustrating debugging session, I realized the problem:
The Docker image wasn’t exposing the port that Coolify’s proxy needed.
Coolify routes traffic to your containers based on the exposed port in the Dockerfile. If you don’t expose it explicitly, the reverse proxy has no idea which port to send traffic to — even if the container is otherwise “working.”
Broken Example
Here’s the Dockerfile I was initially using:
FROM node:18-alpine
WORKDIR /app
COPY . .
RUN npm install --production
# EXPOSE 3000 <-- Was missing
CMD ["npm", "start"]
The app was running on port 3000
internally, but I forgot to add:
EXPOSE 3000
Without this line, the container works fine locally and even passes Coolify’s healthcheck. But Coolify’s reverse proxy (via Caddy) sends the requests to port 3000, but the container is not listening outside of it (that docker compose network) so requests to the domain just silently fail.
Why This Is Frustrating
Coolify doesn’t currently give a clear error or warning when the FQDN is misconfigured due to missing port exposure. It just quietly routes to nowhere. That leads to:
- Misleading health status
- No reverse proxy errors shown in the dashboard
- Time wasted chasing the wrong leads (DNS, SSL, etc.)
Quick Checklist for Coolify + Docker
If you’re deploying via Docker on Coolify, make sure:
- ✅ Your Dockerfile includes
EXPOSE <port>
- ✅ That port matches the one your app listens on
- ✅ Your healthcheck (if set) is hitting the correct internal endpoint
- ✅ You’ve assigned the correct domain and Coolify proxy is enabled
TL;DR
Coolify is great, but silent proxy issues due to unexposed ports can drive you nuts. If your app is “running” but not accessible via the domain, double-check your Dockerfile for the EXPOSE
directive.
It’s a tiny line, but it can save you a big headache. And you will probably only make this misstake once.