# Docker Daemon Fails to Start - "unable to configure ... invalid daemon.json" in CI

> Fix dockerd failing to start in CI - "unable to configure the Docker daemon ... invalid character" from a malformed /etc/docker/daemon.json or a conflicting flag.

Source: https://latchkey.dev/learn/docker/docker-daemon-json-invalid-failed-to-start  
Updated: 2026-06-25

The Docker daemon refused to start because `/etc/docker/daemon.json` is invalid JSON or sets an option that conflicts with a command-line flag. Until the config parses cleanly, dockerd will not come up and every docker command fails to connect.

## Diagnose it: read the container, not the compose file

A container that exits immediately in CI has almost always logged the reason and then been cleaned up. Capture the logs and the exit code before changing configuration.

```Terminal
# why did it stop?
docker ps -a --format '{{.Names}}\t{{.Status}}\t{{.Image}}'
docker logs <container> 2>&1 | tail -50
docker inspect <container> --format '{{.State.ExitCode}} {{.State.OOMKilled}} {{.State.Error}}'
```

> `OOMKilled: true` means the kernel killed it for memory, and no amount of application debugging will explain the log. Exit code 137 is the same event seen from outside.

## FAQ

### What causes Docker daemon fails to start?

There are 3 common causes: malformed json in daemon.json, a directive set both as a flag and in the file, and an unknown or unsupported key. A trailing comma, missing quote, or stray brace makes daemon.json invalid JSON, so the daemon cannot parse its config and refuses to start.

### How do I fix Docker daemon fails to start?

There are 2 fixes depending on which cause you have: validate and fix the json and resolve flag/config conflicts. Work through them in order, since the first is the most common.

### What does Docker daemon fails to start actually mean?

dockerd exits at startup with unable to configure the Docker daemon with file /etc/docker/daemon.json (a JSON parse error) or the following directives are specified both as a flag and in the configuration file.

### How do I stop Docker daemon fails to start happening again?

Lint daemon.json as JSON in CI before applying it. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
