Troubleshooting
5 Common Coolify Docker Errors (and How to Fix Them)
Stuck on your Coolify installation? You're not alone. Here are the quick fixes to get you running.
Deploying Coolify should be simple, but a small typo in your `docker-compose.yml` can lead to frustrating errors. Before you spend hours troubleshooting, see if your problem is one of these common issues.
If you'd rather skip the guesswork and start with a proven, working configuration, we highly recommend following our complete tutorial: The Ultimate Coolify Docker Guide.
Common Installation Errors
Error 1: "Connection Refused" in Browser
The Cause: This almost always happens because of an incorrect port mapping. The Coolify v4 application listens on port 8080 inside its container, but many older guides incorrectly use port 3000.
The Fix: In your `docker-compose.yml`, make sure the `ports` section for the `coolify` service maps to the internal port `8080`.
The Fix: In your `docker-compose.yml`, make sure the `ports` section for the `coolify` service maps to the internal port `8080`.
ports:
- "4000:8080" # Correct
Error 2: "500 Internal Server Error" Page
The Cause: You can connect, but the application itself is failing. This is the classic sign of a missing Laravel `APP_KEY`. The application needs this encryption key to function but can't find it in the environment variables.
The Fix: You must generate a key and add it to your `docker-compose.yml`. Run the following command and paste the output into the `APP_KEY` variable.
The Fix: You must generate a key and add it to your `docker-compose.yml`. Run the following command and paste the output into the `APP_KEY` variable.
# Generate the key
docker run --rm coollabsio/coolify:latest php \
-r "echo 'base64:'.base64_encode(random_bytes(32)).PHP_EOL;"
# Add it to your YAML
environment:
- APP_KEY=REPLACE_WITH_BASE64_APP_KEY
Error 3: Database "Connection Failed" in Logs
The Cause: The `coolify` container cannot reach the `coolify-db` container. This is typically due to a typo in the service hostname or an inconsistent password.
The Fix: First, ensure the hostname in your `DATABASE_URL` matches the `container_name` of your database service (e.g., `coolify-db`). Second, triple-check that the password is exactly the same in the `DATABASE_URL` and the `POSTGRES_PASSWORD` variables.
The Fix: First, ensure the hostname in your `DATABASE_URL` matches the `container_name` of your database service (e.g., `coolify-db`). Second, triple-check that the password is exactly the same in the `DATABASE_URL` and the `POSTGRES_PASSWORD` variables.
Error 4: Forgetting to Generate Secret Keys
The Cause: The `docker-compose.yml` file has placeholder values like `REPLACE_WITH_HEX64` instead of actual, unique keys. Coolify requires both a `COOLIFY_SECRET_KEY` and an `APP_KEY` to be generated by you.
The Fix: Before you deploy, generate both keys using the `openssl` and `docker run` commands provided in our main guide and place them in your compose file.
The Fix: Before you deploy, generate both keys using the `openssl` and `docker run` commands provided in our main guide and place them in your compose file.
Error 5: Redis Connection Issues
The Cause: Similar to the database error, the Coolify container needs to know the correct hostname for the Redis container. A common mistake is using the default `redis` instead of the actual `container_name`.
The Fix: Make sure your `COOLIFY_REDIS_URL` points to the correct service name.
The Fix: Make sure your `COOLIFY_REDIS_URL` points to the correct service name.
# In your coolify service environment:
- COOLIFY_REDIS_URL=redis://coolify-redis:6379
# Must match the redis service container name:
redis:
container_name: coolify-redis
Fix Your Coolify Setup
Need help? Connect on WhatsApp 👉 wa.link/uw9n3f.
Or ask on website chat for freelancer support.