Docker · DevOpsintermediate

Docker daemon.json (Production)

A production-minded Docker daemon.json with log rotation, the overlay2 storage driver, live-restore and sane concurrency limits.

dockerdevopsdaemonloggingcontainers

Preview

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  },
  "storage-driver": "overlay2",
  "live-restore": true,
  "max-concurrent-downloads": 3,
  "max-concurrent-uploads": 5,
  "default-ulimits": {
    "nofile": {
      "Name": "nofile",
      "Hard": 64000,
      "Soft": 64000
    }
  },
  "metrics-addr": "127.0.0.1:9323",
  "experimental": false
}

AI actions

Documentation

Purpose

Configure the Docker Engine host-wide: logging, storage driver, restart behaviour and resource limits.

When to use

On a server or CI host running the Docker daemon, placed at /etc/docker/daemon.json and applied with a daemon restart.

Required fields

  • No fields are required — daemon.json overrides engine defaults selectively.

Optional fields

  • log-driver / log-opts — logging backend and rotation
  • storage-driver — e.g. overlay2
  • live-restore — keep containers running while the daemon restarts
  • default-ulimits, max-concurrent-downloads — resource tuning

Best practices

  • Always set log rotation (max-size/max-file) or disks fill silently.
  • Enable live-restore to survive daemon upgrades without downtime.
  • Validate with `dockerd --validate` before restarting in production.

Security considerations

  • Never expose the daemon on tcp:// without TLS — it is root-equivalent.
  • Bind metrics/experimental endpoints to 127.0.0.1 only.