Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

systemctl cannot start the Docker service on Linux

ErrorFailed 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.

  • Applies to Docker Engine 28, systemd 255, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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-pager
  2. 2Match what you see, then jump to its fix

    1. 1unable 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. 2The 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. 3The daemon ran for a while and then vanished, with no config error in the journalThe host is out of memoryFix

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 ExecStart

2Fix

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/dockerd

3Verify

Reload, restart and check the unit.

sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl is-active docker

Confirmed by docs.docker.com

Did this fix it?

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 dockerd

2Fix

Keep each option in one place only: either the dockerd flags or daemon.json.

sudoedit /etc/docker/daemon.json

3Verify

Restart the service and confirm it is active.

sudo systemctl restart docker
sudo systemctl is-active docker

Confirmed by docs.docker.com

Did this fix it?

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 -h

2Fix

Free memory or add RAM or swap to the host, then start the service again.

sudo systemctl start docker

3Verify

The unit reports active and docker info answers.

sudo systemctl is-active docker
docker info

Confirmed by docs.docker.com

Did this fix it?

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 fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.