Cannot connect to the Docker daemon
The Docker client can't reach the daemon. Check that dockerd is running, then check whether DOCKER_HOST points your client at the wrong place.
What you see
Cannot connect to the Docker daemon. Is 'docker daemon' running on this host?
What it means
The docker command is only a client. It talks to the daemon, dockerd. This error means the client could not reach one. The docs give two reasons: the daemon is not running, or your client is trying to reach a daemon on a different host that is unreachable.
How to confirm the cause
- 1Ask Docker itself
docker info
The docs call this the operating-system independent way to check. If it prints server details, the daemon is up.
- 2Check the service (Linux with systemd)
sudo systemctl is-active docker
You can also look for the
dockerdprocess withpsortop. - 3Check where your client is pointed
env | grep DOCKER_HOST
If this prints a value, the client is talking to a daemon on that host. If it prints nothing, it uses the local daemon.
Causes and fixes
The daemon is not running
- HOW TO TELL
systemctl is-active dockerdoes not sayactive.- FIX
- Start the daemon and try again.
sudo systemctl start docker
DOCKER_HOST is set by mistake
- HOW TO TELL
env | grep DOCKER_HOSTprints a host you did not intend.- FIX
- Unset it, and remove it from files such as
~/.bashrcor~/.profileso it does not come back.unset DOCKER_HOST
Remote daemon unreachable
- HOW TO TELL
DOCKER_HOSTis set on purpose, and the remote host does not answer.- FIX
- Check the daemon is running on the remote host and that no firewall or network outage blocks the connection.
How to stop it coming back
- Enable the service at boot so it starts after a reboot.
- Keep
DOCKER_HOSTout of global shell profiles unless every shell needs it.
Keep going
- Runbook: Docker commands only work with sudo
- Cheat sheet: Docker
- Lesson: the containers topic in Learn
Sources
Docker documentation (docs.docker.com), read 18 Nov 2026 from the official docs repository.