cannot connect to the Docker daemon — how to fix
Quick Answer
# macOS / Windows: start Docker Desktop
open -a Docker # macOS
# Or launch Docker Desktop from Applications
# Linux: start the daemon
sudo systemctl start docker
sudo systemctl enable docker # auto-start on boot
# Verify
docker info
When this happens
Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
Is the docker daemon running?
The Docker CLI cannot reach the daemon because it is not running, or the socket path is wrong.
Other causes & fixes
Check daemon status (Linux)
sudo systemctl status docker
# If inactive:
sudo systemctl start docker
Custom socket or remote daemon
If the daemon uses a custom socket or TCP address, set DOCKER_HOST:
export DOCKER_HOST=unix:///run/user/1000/docker.sock
# or TCP
export DOCKER_HOST=tcp://192.168.1.10:2376
Rootless Docker socket
# The socket lives under the user runtime directory
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
Related