P1
Docker Daemon Not Starting — Troubleshooting Guide
Diagnose and fix a Docker daemon (dockerd) that won't start. Covers configuration errors, storage driver issues, disk space, socket problems, and containerd dependency.
15 min8 steps
Progress: 0/8 steps
0%
Get the current state of the Docker service and any error messages.
systemctl status docker && echo '---' && systemctl is-active containerd
Expected: If docker is 'failed' or 'inactive', check the status output for error hints. containerd must be 'active' — Docker depends on it.
Journal logs contain the specific error preventing startup.
journalctl -u docker --since '30 minutes ago' --no-pager | tail -40
Expected: Common errors: 'failed to start daemon: error initializing graphdriver' (storage), 'address already in use' (port conflict), 'permission denied' (SELinux/AppArmor).
Invalid JSON in daemon.json is a common cause of startup failure.
cat /etc/docker/daemon.json 2>/dev/null && echo '---' && python3 -c 'import json; json.load(open("/etc/docker/daemon.json"))' 2>&1 && echo 'JSON valid' || echo 'JSON INVALID'Expected: Shows the config file and validates JSON syntax. Common errors: trailing commas, unquoted strings, duplicate keys.
If daemon.json doesn't exist, Docker uses defaults — that's fine. Only create it if you need custom settings.
Docker won't start if the storage directory is full.
df -h /var/lib/docker && echo '---' && du -sh /var/lib/docker/* 2>/dev/null | sort -rh | head -10
Expected: If /var/lib/docker filesystem is >95% full, Docker can't create layers or containers. Biggest directories are usually 'overlay2' and 'volumes'.
Verify the storage driver matches the filesystem and kernel.
docker info 2>&1 | grep -E 'Storage|Backing' || cat /etc/docker/daemon.json 2>/dev/null | grep storage
Expected: 'overlay2' is the default and recommended driver. If set to something else (aufs, devicemapper), it may not be supported on your kernel/filesystem.
Stale PID files or sockets from a crashed daemon prevent restart.
ls -la /var/run/docker.pid /var/run/docker.sock /var/run/docker/ 2>/dev/null && echo '---' && fuser /var/run/docker.sock 2>/dev/null && echo 'Socket in use' || echo 'Socket free'
Expected: If docker.pid exists but no Docker process is running, remove it. If the socket is in use by another process, that's a conflict.
Remove stale state and attempt to start Docker again.
# Remove stale PID file if daemon isn't running:
rm -f /var/run/docker.pid
# If disk is full, prune first (may need manual container cleanup):
find /var/lib/docker/containers -name '*-json.log' -size +100M -exec truncate -s 0 {} \;
# Restart containerd first, then docker:
systemctl restart containerd && sleep 2 && systemctl start dockerExpected: Docker daemon should start. Verify with: docker info
Run a test container to confirm everything is operational.
docker ps && echo '---' && docker run --rm hello-world 2>&1 | head -5
Expected: 'Hello from Docker!' confirms the daemon, runtime, and image pulling all work correctly.