Docker Daemon Not Starting on Linux — Fix Guide
Docker daemon fails to start, or the systemd service crashes immediately. Here's how to diagnose dockerd startup failures from storage driver conflicts to corrupted config files.
You run docker ps and get: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Here's how to diagnose and fix it systematically.
Step 1 — Check Service Status
# Check if Docker service is running
sudo systemctl status docker
# If stopped/failed, check why
sudo journalctl -u docker.service -n 50 --no-pager
# Try to start it manually
sudo systemctl start docker
# Check if it stays up
sudo systemctl status docker
sleep 3
sudo systemctl status dockerFix 1 — Corrupted daemon.json
The most common cause. A bad JSON value in /etc/docker/daemon.json prevents startup.
# Check if the file exists and is valid
cat /etc/docker/daemon.json
python3 -m json.tool /etc/docker/daemon.json
# If malformed JSON, you'll see: JSONDecodeErrorCommon broken daemon.json:
{
"storage-driver": "overlay2",
"insecure-registries": ["192.168.1.10:5000",] // Trailing comma — invalid JSON!
}Fix:
# Validate and fix
cat /etc/docker/daemon.json | python3 -c "import sys,json; json.load(sys.stdin); print('Valid JSON')"
# Or just reset to defaults
sudo mv /etc/docker/daemon.json /etc/docker/daemon.json.bak
sudo systemctl start dockerFix 2 — Storage Driver Conflict
# Check journal for storage driver errors
sudo journalctl -u docker.service | grep -i "storage\|overlay\|devicemapper"
# Common error:
# "Error starting daemon: error initializing graphdriver: driver not supported"
# "overlay2: filesystem not supported on this kernel"Fix:
# Check what storage drivers are available
ls /proc/filesystems | grep overlay
# If overlay2 not in kernel modules, load it
sudo modprobe overlay
# Make permanent
echo "overlay" | sudo tee -a /etc/modules-load.d/docker.conf
# Check kernel version (overlay2 needs 4.0+)
uname -rIf still failing, switch storage driver:
// /etc/docker/daemon.json
{
"storage-driver": "vfs" // Fallback (slower but always works)
}Fix 3 — Corrupted Docker Data Directory
# Check for corruption errors in logs
sudo journalctl -u docker.service | grep -i "corrupt\|error\|failed"
# If metadata is corrupted, a clean restart may fix it
sudo systemctl stop docker
sudo rm -rf /var/lib/docker/tmp
sudo systemctl start dockerLast resort — wipe Docker data (DESTROYS ALL IMAGES, CONTAINERS, VOLUMES):
sudo systemctl stop docker
sudo rm -rf /var/lib/docker
sudo systemctl start docker
# After this, Docker starts fresh — no images or containersFix 4 — Port Conflict (Docker Daemon Port)
# Check if docker socket or port is already in use
sudo fuser /var/run/docker.sock
ls -la /var/run/docker.sock
# Remove stale socket
sudo rm /var/run/docker.sock
sudo systemctl start dockerFix 5 — Disk Full
# Check disk space
df -h /var/lib/docker
df -h /
# If full, clean up Docker objects
sudo docker system prune -a --volumes # WARNING: removes all unused data
# Or just dangling images
sudo docker image prune
# Show what's taking space
sudo docker system dfFix 6 — cgroup Version Mismatch
Common on newer Ubuntu/Debian systems:
# Check cgroup version
stat -fc %T /sys/fs/cgroup/
# If output is "cgroup2fs" (cgroup v2), some older Docker configs break
# Check Docker logs for cgroup errors
sudo journalctl -u docker.service | grep cgroupFix for cgroup v2:
// /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}Fix 7 — SELinux or AppArmor Blocking Docker
On RHEL/CentOS/Fedora with SELinux:
# Check if SELinux is blocking
sudo ausearch -m avc -ts recent | grep docker
# Temporary fix (not for production)
sudo setenforce 0
sudo systemctl start docker
# Proper fix — set SELinux to permissive for docker
sudo setsebool -P container_manage_cgroup onOn Ubuntu with AppArmor:
sudo aa-status | grep docker
sudo apparmor_parser -R /etc/apparmor.d/docker 2>/dev/null
sudo systemctl start dockerFull Diagnosis Script
#!/bin/bash
echo "=== Docker Daemon Diagnosis ==="
echo -e "\n--- Service Status ---"
sudo systemctl status docker --no-pager
echo -e "\n--- Recent Logs ---"
sudo journalctl -u docker.service -n 20 --no-pager
echo -e "\n--- Disk Space ---"
df -h /var/lib/docker /
echo -e "\n--- daemon.json ---"
cat /etc/docker/daemon.json 2>/dev/null || echo "No daemon.json found"
echo -e "\n--- Storage Driver Modules ---"
lsmod | grep -E "overlay|dm_|btrfs"
echo -e "\n--- Docker Socket ---"
ls -la /var/run/docker.sock 2>/dev/null || echo "Socket not found"
echo -e "\n--- Kernel Version ---"
uname -rAfter Docker Restarts Successfully
# Verify Docker is working
docker info
docker run --rm hello-world
# Enable Docker to start on boot
sudo systemctl enable dockerFor Docker troubleshooting and container operations, KodeKloud has hands-on Docker labs covering daemon configuration, storage drivers, and container networking.
Stay ahead of the curve
Get the latest DevOps, Kubernetes, AWS, and AI/ML guides delivered straight to your inbox. No spam — just practical engineering content.
Related Articles
AWS ECR Image Push Access Denied — Every Fix (2026)
docker push to ECR fails with 'Access Denied' or 'no basic auth credentials'. Here's every cause — expired token, wrong region, missing IAM permissions, ECR URI mismatch — and the exact fix for each.
AWS ECS Task Keeps Stopping — How to Fix It (2026)
Your ECS task starts and then immediately stops or keeps restarting. Here's every reason this happens and how to debug and fix it.
Docker Build Taking Too Long — Cache and Speed Fixes (2026)
Docker builds taking 10+ minutes every time? Here's how to fix layer caching, use BuildKit properly, and cut build times by 80% with multi-stage builds and cache mounts.