DockerJunior

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

  1. 1
    Ask Docker itself
    docker info

    The docs call this the operating-system independent way to check. If it prints server details, the daemon is up.

  2. 2
    Check the service (Linux with systemd)
    sudo systemctl is-active docker

    You can also look for the dockerd process with ps or top.

  3. 3
    Check 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 docker does not say active.
    FIX
    Start the daemon and try again.
    sudo systemctl start docker
  • DOCKER_HOST is set by mistake

    HOW TO TELL
    env | grep DOCKER_HOST prints a host you did not intend.
    FIX
    Unset it, and remove it from files such as ~/.bashrc or ~/.profile so it does not come back.
    unset DOCKER_HOST
  • Remote daemon unreachable

    HOW TO TELL
    DOCKER_HOST is 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_HOST out of global shell profiles unless every shell needs it.

Keep going

Sources

Docker documentation (docs.docker.com), read 18 Nov 2026 from the official docs repository.

Search

Search cheat sheets and projects