Docker error during connect: daemon down or wrong DOCKER_HOST?
It’s not always that Docker is down. When docker ps or docker run comes back with “Unable to connect to the Docker daemon” or “error during connect”, the client couldn’t reach a daemon. Two unrelated things cause that: the daemon isn’t running, or the client is aimed at a different host. Run docker info to tell which one you have, then follow the matching fix below.
Short version
As of November 2026: run docker info first. It works on any OS and tells you whether Docker is running. If it fails, start the daemon. If the daemon is running, check whether DOCKER_HOST points your client at a different host, and unset it if it does.
docker info
What the error actually means
error during connect
Unable to connect to the Docker daemon
These are example strings, not pasted output. The exact wording varies by setup.


They show up right after any docker command, such as docker ps or docker run. Nothing runs, because the client couldn’t reach a daemon.
The Docker CLI is only a client. It connects to whichever daemon DOCKER_HOST points at, so it can fail even when a daemon is running somewhere else. When DOCKER_HOST is unset, the client connects to the daemon on the local host. That default is why a stray value matters so much: if a shell startup file such as ~/.bashrc or ~/.profile sets it by mistake, the client follows that value every time you open a terminal.
So you have one symptom with two roots. docker info comes first because it separates “nothing is running” from “the client is looking in the wrong place.”
How to fix it
1. Run docker info
One command tells you whether Docker is up, and it behaves the same on every OS.
docker info
If it fails, go to step 2. If you already know the daemon is running and the error persists, skip to step 3.
2. Start the daemon if it may be down
A stopped daemon is one documented cause of “Unable to connect to the Docker daemon”. Start it, then repeat the command that failed. I’ll skip per-OS start commands because the official docs don’t give them. Use whatever matches how you installed Docker.
Run docker info again. If it succeeds, you’re done. If the daemon won’t start, jump to step 5.
If it still fails while the daemon looks healthy, don’t stop at “the daemon must be down.” A down daemon is only half the story, and the other half is in step 3.
3. Check where the client is pointed
A healthy daemon doesn’t help if the client is talking to a different host. The DOCKER_HOST variable in your environment decides which host that is. Print it:

echo $DOCKER_HOST
Empty output means the variable is unset, so the client goes to the daemon on the local host. A value means the client is using that host. Compare it with where your daemon actually runs.
What if it’s an address you don’t recognize? That doesn’t automatically make it the bug. The client follows whatever daemon that variable names, so the value may be intentional if you meant to reach another host.
If you never set it yourself, suspect a shell startup file. Step 4 covers that.
4. Unset DOCKER_HOST and find where it came from
Clear the variable in your current shell and try again. Without DOCKER_HOST, the client connects to the local daemon.
unset DOCKER_HOST
docker info
If docker info works now, DOCKER_HOST was the culprit. But unset isn’t permanent. It only clears the variable in the current shell, so the error comes back in the next terminal if something sets it at startup. Shell startup files such as ~/.bashrc and ~/.profile can set DOCKER_HOST by mistake, so search them:
grep DOCKER_HOST ~/.bashrc ~/.profile
Remove or correct the matching line, open a new shell, and run docker info once more. If the line is there on purpose because you do use a remote host, correct the address rather than deleting it.
5. Check for config conflicts if the daemon won’t start
When the daemon refuses to start, the cause depends on your setup.

| Setup | What to check |
|---|---|
Standalone dockerd |
Settings live in daemon.json, and you also pass options to dockerd by hand or in start-up scripts. If the two sources disagree, the daemon fails to start and reports an error. |
| Docker Desktop for Windows or Mac | Setting hosts in daemon.json isn’t supported. If you added it, remove it. |
On Docker Desktop, the hosts key is the first thing to look for. Docker’s docs say it isn’t supported in daemon.json on Docker Desktop for Windows or Mac (as of November 2026), so don’t add it there.
On standalone dockerd, you can hit a clash even if you never passed a flag yourself, because start-up scripts may hand options to dockerd for you. A setting defined in both those options and daemon.json with conflicting values makes Docker fail to start and print an error. Compare daemon.json with the flags your start-up scripts pass, and treat any option that appears in both places as a suspect. Keep it in one place only, start the daemon again, and run docker info to confirm.
Sources
This article was created using generative AI based on publicly available sources.