docker cannot connect to the daemon
"Cannot connect to the Docker daemon" or "permission denied" on docker.sock: start the service, or let your user use it.
Steps
-
systemctl status dockeris the service running?
-
sudo systemctl enable --now dockerstart it, and at every boot
-
ls -l /var/run/docker.sockwho may use the socket: root and the docker group
-
sudo usermod -aG docker $USERjoin the docker group, then log out and in
-
docker infocheck it works
Notes
- The docker group is as good as root: only add users you trust.
- macOS and Windows: start Docker Desktop.
Commands used
dockersystemctlusermod
Each has a page in lore: lore docker opens it.