Error response from daemon: Container X is not running
You tried to exec into or interact with a container that has stopped.
is not runningContainer is not runningError response from daemon: Container Meaning
docker exec only works on running containers. The container probably crashed or exited right after start — check its logs and exit code, then start it again or run a new one interactively.
Common causes
- Container exited (crash or finished CMD)
- Container stopped manually or by restart policy
- Container paused/restarting
⚡ Quick fix
- docker logs <container> to see why it stopped
- docker start <container> then exec
- Debug with docker run -it --entrypoint sh image
Detailed fix by platform
Docker
- bash
docker logs --tail 50 web docker start web && docker exec -it web sh
How to diagnose
- State — docker inspect -f '{{.State.Status}} {{.State.ExitCode}}' web
- Logs — Why did it stop?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- ACR unauthorized Azure Container Registry: unauthorized: authentication required, visit https://aka.ms/acr/authorization (AKS ErrImagePull 401)
- AWS_CA_BUNDLE AWS CLI/SDK: SSL validation failed for https://... certificate verify failed (custom CA bundle / proxy)
- CannotPullContainerError ECS task stopped: CannotPullContainerError: pull image manifest has been retried ... / ref pull has been retried
Most viewed in Docker
- docker-credential-desktop error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH
- pull access denied pull access denied for image, repository does not exist or may require 'docker login'
- lookup registry-1.docker.io: no such host dial tcp: lookup registry-1.docker.io: no such host / Temporary failure in name resolution during docker build
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 14 Oct 2026