Dockerexit code > 0

Cannot connect to the Docker daemon

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

Analysis

The Docker client cannot communicate with the Docker daemon (engine).

Common Triggers

  • Docker service is not started.
  • Current user does not have permission to access /var/run/docker.sock.

Debug Checks

  • $Run systemctl status docker (Linux).
  • $Check if docker.sock exists and its permissions.

Resolution

1
Start Docker: sudo systemctl start docker.
2
Add user to docker group: sudo usermod -aG docker $USER (requires re-login).