Docker How to fix Job for docker.service failed because the control process exited with error code
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
When Docker refuses to start on Linux and you see "Job for docker.service failed because the control process exited with error code," it means the Docker daemon crashed during startup. This is frustrating because the error message itself tells you almost nothing about the root cause. The fix depends on reading the actual logs and identifying which of several common problems is preventing the daemon from initializing.
Checking the Logs
Your first step is always to read the detailed error output. The one-line systemd message is just a wrapper. The real information is in the journal and the Docker log file.
Look for lines containing "error", "fatal", or "failed" near the end of the output. The specific error message determines which fix to apply.
Cause 1 -- daemon.json Syntax Error
The most common cause is a malformed /etc/docker/daemon.json file. A single missing comma, trailing comma, or unquoted key will prevent the daemon from starting.
If this command reports an error, fix the syntax. Here is an example of a correct daemon.json:
Common JSON mistakes include trailing commas after the last item in an object, single quotes instead of double quotes, and comments (JSON does not support comments).
Cause 2 -- Storage Driver Issues
If the logs mention "failed to start daemon" with references to "overlay2", "devicemapper", or "aufs", the storage driver is misconfigured or the required kernel module is not loaded.
If you recently changed the storage driver in daemon.json, Docker cannot read images created with the old driver. Either remove the setting to use the default, or clear the old data directory:
Cause 3 -- Disk Space Exhaustion
Docker will fail to start if the partition containing /var/lib/docker is full.
Free space by pruning unused images, containers, and volumes:
If Docker will not start at all, you may need to manually remove files from /var/lib/docker/tmp or clear old container logs under /var/lib/docker/containers/.
Cause 4 -- Conflicting Installations
Installing Docker from multiple sources (for example, both the Ubuntu docker.io package and Docker's official repository) causes file conflicts and broken systemd units.
Cause 5 -- Socket Permission or Leftover PID File
Sometimes a stale PID file or socket prevents the daemon from starting:
Applying the Fix and Restarting
After fixing the underlying issue, always reload the systemd configuration before restarting:
If the service starts but fails again after a reboot, make sure Docker is enabled:
Clean Reinstall Steps
If none of the above fixes work, a clean reinstall often resolves the issue. This removes all Docker data including images and containers:
Common Pitfalls
- Skipping the logs and guessing: The journal output tells you exactly what went wrong. Always read
journalctl -xeu docker.servicebefore trying random fixes. - Editing daemon.json without validating JSON: A trailing comma or missing brace silently breaks Docker startup. Always validate with
python3 -m json.toolafter editing. - Forgetting
systemctl daemon-reload: After modifying systemd unit files or Docker's configuration, systemd must reload its cache. Skipping this step means your changes have no effect. - Mixing Docker installation sources: Having both
docker.io(distro package) anddocker-ce(official Docker package) installed creates conflicts. Pick one source and remove the other. - Deleting
/var/lib/dockerwithout a backup: This removes all images, containers, and volumes. Always back up or confirm you can rebuild before deleting.
Summary
- Always start by reading the actual logs with
journalctl -xeu docker.servicerather than guessing from the generic error message. - The most common causes are a malformed
daemon.json, storage driver misconfiguration, disk space exhaustion, conflicting package installations, and stale PID or socket files. - After fixing the root cause, run
systemctl daemon-reloadfollowed bysystemctl start dockerto restart the service. - If all else fails, a clean uninstall and reinstall from Docker's official repository resolves most persistent issues.
- Always validate configuration files and check disk space before assuming the problem is complex.

