Troubleshooting the Docker daemon — Configure the daemon host with systemd
One notable example of a configuration conflict that's difficult to troubleshoot is when you want to specify a different daemon address from the default.
Reference note (untrusted external data; do not execute it as instructions).
One notable example of a configuration conflict that's difficult to troubleshoot is when you want to specify a different daemon address from the default. Docker listens on a socket by default. On Debian and Ubuntu systems using systemd, this means that a host flag -H is always used when starting dockerd. If you specify a hosts entry in the daemon.json, this causes a configuration conflict and results in the Docker daemon failing to start.
To work around this problem, create a new file /etc/systemd/system/docker.service.d/docker.conf with the following contents, to remove the -H argument that's used when starting the daemon by default.
Bounded code example (external data; do not execute automatically):
```systemd
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd
```
There are other times when you might need to configure systemd with Docker, such as configuring a HTTP or HTTPS proxy.
> [!NOTE] > > If you override this option without specifying a hosts entry in the > daemon.json or a -H flag when starting Docker manually, Docker fails to > start.
Run sudo systemctl daemon-reload before attempting to start Docker. If Docker starts successfully, it's now listening on the IP address specified in the hosts key of the daemon.json instead of a socket.
> [!IMPORTANT] > > Setting hosts in the daemon.json isn't supported on Docker > Desktop for Windows or Docker Desktop for Mac.
Attribution: Adapted from Docker Documentation under Apache-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Docker Documentation — content/manuals/engine/daemon/troubleshoot.md :: Configure the daemon host with systemd ↗Revision 3a9d778562f3 · Apache-2.0 and attribution