Error Knowledge Base DOCKER cannot_connect_to_daemon

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

The Docker CLI can't connect to the Docker daemon (engine).

Affected versions: All supported Docker Engine and Docker CLI versions.

What This Error Means

The Docker CLI can't connect to the Docker daemon (engine).

How to Fix It

  1. Check daemon connectivity: docker version (server section should appear).
  2. If Docker is not running, start/restart it (Docker Desktop, or sudo systemctl start docker).
  3. Check active context: docker context ls and docker context show.
  4. If using a remote daemon, validate DOCKER_HOST and TLS settings.

Why It Happens

  • The Docker daemon is not running.
  • You are pointing at the wrong Docker context/host (DOCKER_HOST / context mismatch).
  • You do not have permission to access the Docker socket.

How to Verify

  1. Run docker info and confirm it returns daemon details.
  2. Retry the original Docker command.

Manual daemon access checks

  1. On Linux, check socket permissions: ls -la /var/run/docker.sock.
  2. Confirm your user groups include docker (then re-login): groups.

Common CLI Output

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Cannot connect to the Docker daemon. Is 'docker daemon' running on this host?

How Docker CLI talks to the daemon

  1. The Docker CLI is a client that talks to the Docker daemon via a Unix socket or TCP.
  2. When the daemon is down, unreachable, or blocked by permissions, the CLI fails immediately.

Prevention Tips

  • Keep Docker Desktop / Docker Engine updated on build machines.
  • Avoid hardcoding DOCKER_HOST unless you truly need remote contexts.
  • Monitor daemon health on CI runners.

Where This Can Be Triggered

docs.docker.com/engine/install/linux-postinstall/

Official Docker documentation reference connected to this failure mode. - Source

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list