`Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`
BeginnerTroubleshootingDaemon, install and permissions
Answer
Likely causes → dockerd is stopped, crashed, not installed, or DOCKER_HOST/context points elsewhere.
Diagnose →
systemctl status docker
journalctl -u docker --no-pager -n 50
echo $DOCKER_HOST; docker context ls
Fix → sudo systemctl enable --now docker. Unset a stale DOCKER_HOST or docker context use default. On Docker Desktop start the app.
Prevent → Enable the service at boot and monitor it.
More on Daemon, install and permissions
`permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock`Beginnerdockerd fails to start after editing `daemon.json`: `unable to configure the Docker daemon with file /etc/docker/daemon.json`Intermediate`docker: command not found` right after installing Docker Desktop on macOS.Beginner`docker info` shows `WARNING: bridge-nf-call-iptables is disabled`IntermediateDocker service flaps with `failed to start daemon: Error initializing network controller: ... iptables failed`Intermediate`docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io: no such host`Intermediate