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