Docker & DevOps

Common Docker errors and how to fix them

A quick reference to the Docker and Docker Compose errors you meet most often on a VPS, what each one means and the command that fixes it.

IntermediateLinux VPS3 min read

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 CONTAINER or docker compose logs SERVICE.

Quick reference

Error messageCauseFix
permission denied while trying to connect to the Docker daemon socketYour user is not in the docker groupsudo 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 failedsudo systemctl start docker, then read journalctl -u docker
Bind for 0.0.0.0:80 failed: port is already allocatedAnother container or service uses that host portFind it with sudo ss -tlnp | grep :80, stop it or publish a different port
Conflict. The container name "/web" is already in useAn old stopped container has the same namedocker rm web or docker compose up -d --force-recreate
no space left on deviceImages, build cache, logs or volumes filled the diskdocker system df, then docker system prune
toomanyrequests: You have reached your pull rate limitAnonymous Docker Hub pull limitdocker login, or wait and retry
manifest unknown / not foundWrong image name or tagCheck the tag on the registry; avoid typos in image:
exec format errorImage built for another CPU architecture (ARM vs x86)Use a multi-arch image or build with --platform linux/amd64
Container status Exited (1) or RestartingThe app inside crashed on startdocker 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 foundCompose network removed while containers referenced itdocker compose down then docker compose up -d
yaml: line N: did not find expected keyIndentation error in compose.yamlUse spaces, not tabs; validate with docker compose config

A step-by-step way to debug any container

  1. See the state of everything: docker ps -a (or docker compose ps -a).
  2. Read the last log lines: docker logs --tail 100 CONTAINER.
  3. Look at the exit code and OOM flag: docker inspect CONTAINER --format '{{.State.ExitCode}} {{.State.OOMKilled}}'.
  4. Check the resolved compose file for typos: docker compose config.
  5. Open a shell in a running container to test from inside: see docker exec into a container.
  6. Check host resources: df -h, free -m and docker 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

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.