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 cannot reach the Docker daemon, usually because the engine is stopped, the context is wrong, or the socket is unavailable.

What This Error Means

The Docker CLI cannot reach the Docker daemon, usually because the engine is stopped, the context is wrong, or the socket is unavailable.

How to Fix It

Check daemon connectivity:docker version (server section should appear).

If Docker is not running, start/restart it (Docker Desktop, or sudo systemctl start docker).

Check active context:docker context ls and docker context show

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

Run docker info and confirm it returns daemon details.

Retry the original Docker command.

Manual daemon access checks

On Linux, check socket permissions:ls -la /var/run/docker.sock

Confirm your user groups include docker (then re-login): groups.

Examples

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

The Docker CLI is a client that talks to the Docker daemon via a Unix socket or TCP.

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.

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

Join our mailing list