systemctl cannot start the Docker service on Linux
Failed to start Docker Application Container Engine.Short answer
The message only says dockerd exited. The reason is in the journal. Read it with journalctl first. The usual causes are a daemon.json that is invalid or sets an option that is also a flag in the systemd unit (often hosts), and a host that has run out of memory.
Fix it fast
1Find out which cause you have
Read the last log lines of the docker unit. The line before the failure names the reason.
sudo systemctl is-active docker sudo journalctl --unit=docker --lines=40 --no-pager2Match what you see, then jump to its fix
- 1
unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration filedaemon.json conflicts with a flag in the service fileFix - 2
The journal names a directive set as a flag and in the config file, but it is not hostsThe same option is set twice by handFix - 3
The daemon ran for a while and then vanished, with no config error in the journalThe host is out of memoryFix
- 1
What does the error look like?
Failed to start Docker Application Container Engine.unable to configure the Docker daemon with file /etc/docker/daemon.json
Cause 1 of 3
daemon.json conflicts with a flag in the service file
1Check
On systemd hosts a hosts entry in daemon.json clashes with the -H flag in the default unit. Show both.
cat /etc/docker/daemon.json
systemctl cat docker | grep ExecStart2Fix
Remove the duplicate option from one side. To keep hosts in daemon.json, override ExecStart with a drop-in that drops the flag, then reload systemd.
# /etc/systemd/system/docker.service.d/docker.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd3Verify
Reload, restart and check the unit.
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl is-active dockerConfirmed by docs.docker.com
Cause 2 of 3
The same option is set twice by hand
1Check
If the same option is passed on the dockerd command line and in the JSON file, the daemon will not start and prints an error. Look for the option in both places.
cat /etc/docker/daemon.json
systemctl cat docker | grep dockerd2Fix
Keep each option in one place only: either the dockerd flags or daemon.json.
sudoedit /etc/docker/daemon.json3Verify
Restart the service and confirm it is active.
sudo systemctl restart docker
sudo systemctl is-active dockerConfirmed by docs.docker.com
Cause 3 of 3
The host is out of memory
1Check
The kernel OOM killer can stop the daemon. See how much memory is free.
free -h2Fix
Free memory or add RAM or swap to the host, then start the service again.
sudo systemctl start docker3Verify
The unit reports active and docker info answers.
sudo systemctl is-active docker
docker infoConfirmed by docs.docker.com
How do I stop it coming back?
- Keep daemon options in /etc/docker/daemon.json only, not in custom unit files.
- Check JSON syntax after every edit and read the journal when you restart.
- Watch memory use on small servers that run containers.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
The docker command cannot reach the Docker daemon
Cannot connect to the Docker daemon at unix:///Users/<user>/.docker/run/docker.sock. Is the docker daemon running?
This error means the docker client could not talk to a running daemon.
4 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
sam local fails: Running AWS SAM projects locally requires Docker
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
sam local start-api and sam local invoke run your function inside a Docker container, so SAM stops if it cannot talk to Docker.
3 causes, each with a fixServers
dnf fails to download repo metadata in a CentOS 8 Docker build
The same Dockerfile built fine before 2022
CentOS Linux 8 reached end of life on 31 December 2021 and its content left the mirrors.
2 causes, each with a fixServers
pip install confluent-kafka fails because librdkafka/rdkafka.h is missing
pip stops while building confluent-kafka from source
The error means pip is compiling confluent-kafka from source, and the compiler cannot find the librdkafka C headers.
3 causes, each with a fixServers
Cypress says the npm package is installed but the binary is missing
Cypress binary is missing after npm install in CI or in a Docker build
The npm package is only a launcher.
3 causes, each with a fix