Most Docker problems on a server come down to a short list of error messages. Use this page to match the error you see to its cause, then follow the link to the detailed guide if the quick fix is not enough.
Before you start
- SSH access to the Docker host.
- The exact error text. Get it from the command output,
docker logs CONTAINERordocker compose logs SERVICE.
Quick reference
| Error message | Cause | Fix |
|---|---|---|
permission denied while trying to connect to the Docker daemon socket | Your user is not in the docker group | sudo usermod -aG docker $USER, then log out and back in |
Cannot connect to the Docker daemon. Is the docker daemon running? | The Docker service is stopped or failed | sudo systemctl start docker, then read journalctl -u docker |
Bind for 0.0.0.0:80 failed: port is already allocated | Another container or service uses that host port | Find it with sudo ss -tlnp | grep :80, stop it or publish a different port |
Conflict. The container name "/web" is already in use | An old stopped container has the same name | docker rm web or docker compose up -d --force-recreate |
no space left on device | Images, build cache, logs or volumes filled the disk | docker system df, then docker system prune |
toomanyrequests: You have reached your pull rate limit | Anonymous Docker Hub pull limit | docker login, or wait and retry |
manifest unknown / not found | Wrong image name or tag | Check the tag on the registry; avoid typos in image: |
exec format error | Image built for another CPU architecture (ARM vs x86) | Use a multi-arch image or build with --platform linux/amd64 |
Container status Exited (1) or Restarting | The app inside crashed on start | docker logs CONTAINER and fix the config or env vars |
Exited (137) | Killed for running out of memory (OOM) | Raise the memory limit or add RAM; check docker inspect for OOMKilled |
network ... not found | Compose network removed while containers referenced it | docker compose down then docker compose up -d |
yaml: line N: did not find expected key | Indentation error in compose.yaml | Use spaces, not tabs; validate with docker compose config |
A step-by-step way to debug any container
- See the state of everything:
docker ps -a(ordocker compose ps -a). - Read the last log lines:
docker logs --tail 100 CONTAINER. - Look at the exit code and OOM flag:
docker inspect CONTAINER --format '{{.State.ExitCode}} {{.State.OOMKilled}}'. - Check the resolved compose file for typos:
docker compose config. - Open a shell in a running container to test from inside: see docker exec into a container.
- Check host resources:
df -h,free -manddocker stats.
Tip: Containers that can't reach each other by name are usually on different networks. Put them in the same compose file or the same user-defined network, as shown in Docker networks explained.
Detailed guides for each problem
- Permission denied on the Docker socket
- Docker daemon won't start
- Container exits immediately
- Free disk space with docker prune
- Container networking troubleshooting
Next steps
- View and rotate container logs so logs never fill the disk again.
- Choose the right restart policy.
- Manage containers in Portainer if you prefer a web UI.
