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

The docker CLI can’t talk to the Docker engine — it isn’t running, or your user can’t access the socket.

Exact message you may see Cannot connect to the Docker daemonIs the docker daemon runningpermission denied while trying to connect to the Docker daemon socket
Seen on: Docker Linux

Meaning

The docker command is just a client; the daemon does the work. On Linux the socket is root-owned unless you’re in the docker group. On macOS/Windows, Docker Desktop must be running.

Common causes

  • Docker daemon/Desktop not started
  • User not in docker group (permission denied on docker.sock)
  • DOCKER_HOST / context pointing elsewhere
  • Rootless Docker uses a different socket path

⚡ Quick fix

  1. Start Docker: sudo systemctl start docker or open Docker Desktop
  2. Add yourself to the group: sudo usermod -aG docker $USER then log out/in
  3. Check docker context ls and echo $DOCKER_HOST

Detailed fix by platform

Linux

  1. Enable and verify:
    bash
    sudo systemctl enable --now docker
    sudo usermod -aG docker $USER && newgrp docker
    docker info

How to diagnose

  1. Daemon — Is it running?
  2. Permission — “permission denied” on docker.sock?
  3. Context — Which context/host is the CLI using?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

AADSTS65001 — AADSTS65001: The user or administrator has not consented to use the application (Azure)AADSTS65001Access to the path is denied — System.UnauthorizedAccessException: Access to the path 'x' is denied (.NET)Access to the path is…AccessDeniedException — java.nio.file.AccessDeniedException: /path (Java)AccessDeniedExceptionarchive — /etc/letsencrypt/live/<domain>/privkey.pem symlink to archive unreadable (permissions after certbot upgrade) (SSL / TLS)archiveclient version is too new — Error response from daemon: client version 1.45 is too new. Maximum supported API version is 1.41 (Docker)client version is too…clipboard write blocked — NotAllowedError: Failed to execute 'writeText' on 'Clipboard': Document is not focused. (JavaScript)clipboard write block…Conflict container name — Conflict. The container name "/x" is already in use by container … (Docker)Conflict container na…could not select device driver — could not select device driver "" with capabilities: [[gpu]] (Docker)could not select devi…daemon

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.