Ubuntu 16.04.4 LTS安装Docker CE失败:docker.service启动报错
Hey there, I’ve run into this exact issue a few times when setting up Docker on older Ubuntu releases—let’s walk through how to diagnose and fix it step by step.
First, let’s get to the root of the problem by checking the detailed error logs, since the initial message only tells us the service failed without specifics.
Step 1: Grab Detailed Error Information
Run these commands to see exactly why Docker won’t start:
- Check the Docker service status for immediate clues:
This will show you the last few lines of the service’s output, like missing dependencies or configuration errors.sudo systemctl status docker.service - Dig deeper into system logs for more context:
This filters the system journal to only show Docker-related entries, which often reveal issues like storage driver conflicts or port clashes.sudo journalctl -xe | grep docker
Step 2: Try Common Fixes Based on Typical Issues
Fix 1: Resolve Storage Driver Problems
Ubuntu 16.04 sometimes has issues with the default aufs storage driver. Here’s how to fix that:
- Check if the
aufskernel module is loaded:lsmod | grep aufs - If you don’t see any output, load the module manually:
sudo modprobe aufs - Restart Docker to test:
sudo systemctl restart docker
If aufs still causes trouble, switch to the overlay2 driver (more stable for most setups):
- Create or edit the Docker daemon config file:
sudo nano /etc/docker/daemon.json - Add this content:
{ "storage-driver": "overlay2" } - Save the file (Ctrl+O, Enter, then Ctrl+X), then restart Docker:
sudo systemctl restart docker
Fix 2: Reinstall Docker with Full Dependencies
Sometimes the installation skips or corrupts dependencies. Reinstalling can fix this:
sudo apt-get install --reinstall docker-ce docker-ce-cli containerd.io
After reinstalling, try starting the service again:
sudo systemctl start docker
Fix 3: Clear Old Docker Residues
If you had a previous Docker installation (even a partial one), leftover files can break the new setup. Clean everything up and start fresh:
- Purge existing Docker packages:
sudo apt-get purge docker-ce docker-ce-cli containerd.io - Delete all Docker data and config directories:
sudo rm -rf /var/lib/docker sudo rm -rf /etc/docker - Reinstall Docker CE:
sudo apt-get install docker-ce
Fix 4: Check for Port Conflicts
Docker uses port 2375 (unencrypted) or 2376 (encrypted) by default. If another service is using these ports, Docker won’t start. Check for conflicts with:
sudo ss -tulpn | grep docker
If you see another process using the port, stop that service or modify Docker’s port configuration in /etc/docker/daemon.json.
Step 3: Verify the Fix
Once you’ve tried a fix, test if Docker works properly:
- Start the service (if not already running):
sudo systemctl start docker - Check the service status to confirm it’s active:
sudo systemctl status docker.service - Run the hello-world container to ensure everything is functioning:
sudo docker run hello-world
If you still run into issues, share the output from the systemctl status and journalctl commands—those details will help narrow down the problem further.
内容的提问来源于stack exchange,提问作者Nico Schuck

