← Knowledge Base
DockerReference note1 min read · updated 2026-11-27

A container will not start: how to find out why

A short checklist: status, logs, exit code, config, ports and permissions.

dockertroubleshooting
docker ps -a                              # status and exit code ("Exited (1)")
docker logs --tail 100 <name>             # the real error is usually here
docker inspect -f '{{.State.ExitCode}} {{.State.Error}}' <name>
docker compose config                     # YAML/variable mistakes
docker events --since 10m                 # what the daemon did
ss -tlnp | grep :80                       # is the port already used?

Typical causes: a port already in use, a missing or wrongly owned volume path, an environment variable that is not set, the wrong CPU architecture (exec format error means an x86 image on ARM or the reverse), an out-of-memory kill (docker inspect shows OOMKilled: true) or a restart loop (Restarting). Run the image interactively to look around: docker run --rm -it --entrypoint sh <image>.