ProjectStack
docker

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

Docker can't reach its background service (the daemon). Every Docker command — run, build, pull — talks to the daemon through a socket file, and if that file isn't there or the daemon isn't listening, nothing works. Either Docker isn't running or the socket path is wrong.

Common causes

  • Docker Desktop isn't started — open the app and wait for it to be ready
  • The dockerd service isn't running on a Linux server: sudo systemctl status docker
  • The DOCKER_HOST environment variable is set to a wrong address
  • Running inside a CI container without Docker-in-Docker configured

How to fix it

  1. On Mac/Windows: start Docker Desktop from the Applications menu or system tray
  2. On Linux: start the service: sudo systemctl start docker, then enable it to start on boot: sudo systemctl enable docker
  3. Verify the daemon is up: sudo systemctl status docker or docker info
  4. If DOCKER_HOST is set, unset it or correct it: unset DOCKER_HOST

Example

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

Running docker ps on a Linux machine where the Docker service hasn't been started

Browse more errors

The Developer Hub covers 150+ errors across Git, npm, Node.js, Python, TypeScript, and Docker — with plain-English explanations and fix steps.