Introduction When the Docker daemon stops responding, all container management operations fail. This blocks deployments, scaling, and even basic container inspection. The daemon may hang due to storage driver issues, disk exhaustion, or deadlocks.

Symptoms - `docker ps` hangs indefinitely or returns "Cannot connect to the Docker daemon" - Error: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock" - `systemctl status docker` shows "active (running)" but commands fail - Container operations timeout - Docker log shows storage driver errors

Common Causes - Docker storage driver deadlock (overlay2 corruption) - Docker socket permissions changed - Disk full preventing Docker operations - Docker daemon process hung on long-running operation - Systemd watchdog timeout not triggering restart

Step-by-Step Fix 1. **Check Docker daemon status**: ```bash systemctl status docker journalctl -u docker --since "30 minutes ago" --no-pager ```

  1. 1.Check if Docker socket exists and has correct permissions:
  2. 2.```bash
  3. 3.ls -la /var/run/docker.sock
  4. 4.# Should be: srw-rw---- 1 root docker
  5. 5.`
  6. 6.Restart Docker daemon:
  7. 7.```bash
  8. 8.systemctl restart docker
  9. 9.# If that hangs, force kill and restart
  10. 10.killall -9 dockerd
  11. 11.systemctl start docker
  12. 12.`
  13. 13.Check disk space:
  14. 14.```bash
  15. 15.df -h /var/lib/docker
  16. 16.# If full, clean up
  17. 17.docker system prune -af
  18. 18.`
  19. 19.Reset Docker storage if corrupted:
  20. 20.```bash
  21. 21.systemctl stop docker
  22. 22.rm -rf /var/lib/docker/*
  23. 23.systemctl start docker
  24. 24.# Note: This removes ALL images, containers, and volumes
  25. 25.`

Prevention - Configure log rotation in daemon.json - Monitor /var/lib/docker disk usage - Set systemd TimeoutStartSec appropriately - Use `docker system prune` regularly - Consider switching to containerd or Podman for better reliability