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

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

Export

Fixes 'Cannot connect to the Docker daemon' errors when the Docker Engine service is stopped or never started. Use when every docker command fails with a daemon connection error on Linux. Not for permission-denied socket errors or Docker Desktop npipe errors on Windows, which have separate causes.

TL;DR: Start the Docker service. On systemd run sudo systemctl start docker and sudo systemctl enable docker so it survives reboots, then docker ps should list containers instead of the error. This happens because the docker CLI is just a client; it needs the dockerd server process running to do anything.

The error

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

Fix it

  1. Check whether the service exists and its state:

sudo systemctl status docker Expected: either inactive (dead) (fixable) or Unit docker.service could not be found (not installed).

  1. Start it:

sudo systemctl start docker Expected: no output, exit code 0.

  1. Enable it at boot so this does not come back after a reboot:

sudo systemctl enable docker Expected: Created symlink /etc/systemd/system/multi-user.target.wants/docker.service ...

  1. Verify the client can reach the daemon:

docker ps Expected: a container table (possibly empty), not the error.

When this applies

  • Fresh Linux install where Docker was installed but never started
  • After a reboot, if the service was never enabled
  • docker context ls shows the default unix socket context as current

When this does NOT apply

  • The error says "permission denied" instead (socket exists but your user cannot read it; fix is the docker group, separate skill)
  • Docker Desktop on macOS/Windows (the daemon runs inside a VM; start the Desktop app instead)
  • DOCKER_HOST points at a remote or tcp address (context problem, separate skill)

Versions

Docker Engine 20.10 through 29.x on any systemd Linux distro. Non-systemd distros (Alpine/OpenRC) use sudo service docker start instead.

Why it happens

docker is a thin client that talks to the dockerd daemon over a unix socket. Package installs create the systemd unit but do not always start or enable it, so the first docker command after install or reboot finds no socket listener.

Edge cases

  • WSL2 without systemd: enable systemd in /etc/wsl.conf or start dockerd manually in the background.
  • If systemctl start docker fails, check sudo journalctl -u docker --no-pager | tail -30 for the real cause (often a bad /etc/docker/daemon.json).
  • Inside CI containers, you need docker-in-docker or a mounted socket; starting the service inside the job container is not the fix.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=Cannot+connect+to+the+Docker+daemon+at+unix%3A%2F%2F%2Fvar%2Frun%2Fdocker.sock.+Is+the+docker+daemon+running%3F&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.