Configuring the Docker Daemon with daemon.json
Master /etc/docker/daemon.json configuration: customize data-root paths, default log drivers, network subnets, and reload settings seamlessly using live-restore and SIGHUP.
Published on • November 17, 2026
AI Assistant

The Docker daemon (dockerd) controls image storage, container execution, default networking, and logging behavior on Linux hosts. While CLI flags can configure dockerd, the standard, maintainable method is declaring parameters in /etc/docker/daemon.json.
This guide covers key configuration options, how to customize storage and network settings, and how to reload daemon configuration without dropping running containers.
File Location and Validating JSON Syntax
On Linux systems, the configuration file resides at:
/etc/docker/daemon.json
On Windows hosts running Docker Engine natively:
C:\ProgramData\docker\config\daemon.json
Because invalid JSON will cause dockerd startup failures, validate syntax using jq before restarting the service:
jq . /etc/docker/daemon.json
Essential daemon.json Configuration Example
Here is a production-ready template demonstrating common settings:
{
"data-root": "/mnt/fast-nvme/docker",
"storage-driver": "overlay2",
"log-driver": "json-file",
"log-opts": {
"max-size": "50m",
"max-file": "5"
},
"bip": "172.28.0.1/16",
"default-address-pools": [
{
"base": "10.200.0.0/16",
"size": 24
}
],
"live-restore": true,
"userland-proxy": false,
"no-new-privileges": true,
"metrics-addr": "127.0.0.1:9323"
}
Detailed Option Breakdown
1. data-root: Changing Docker Storage Directory
By default, Docker stores images, containers, volumes, and build cache in /var/lib/docker. If your root partition has limited capacity, move the storage directory to a dedicated partition or NVMe mount using data-root:
{
"data-root": "/mnt/fast-nvme/docker"
}
Migration Tip: Stop Docker (
systemctl stop docker), sync existing data (rsync -aHAX /var/lib/docker/ /mnt/fast-nvme/docker/), updatedaemon.json, and start Docker (systemctl start docker).
2. log-driver & log-opts: Log Rotation Control
Unbounded container stdout/stderr logs can fill up host disks. Setting default log limits in daemon.json ensures all new containers automatically inherit log rotation:
{
"log-driver": "json-file",
"log-opts": {
"max-size": "50m",
"max-file": "5"
}
}
Alternative drivers like local, journald, or loki can also be configured here.
3. bip: Customizing Default Bridge IP Subnet
By default, Docker assigns 172.17.0.1/16 to docker0. To avoid IP range collisions with corporate VPNs or internal networks, specify bip (Bridge IP):
{
"bip": "172.28.0.1/16"
}
4. storage-driver: Explicit Storage Engine
While modern Linux distributions default to overlay2, you can explicitly enforce storage driver settings:
{
"storage-driver": "overlay2"
}
5. live-restore: Zero-Downtime Daemon Restarts
Enabling live-restore allows containers to remain running even when the Docker daemon is being updated, restarted, or experiencing a crash:
{
"live-restore": true
}
Reloading Configuration without Container Downtime
Certain configuration changes (such as log settings, registry mirrors, or metrics endpoints) can be reloaded without restarting the daemon or stopping running containers.
Method 1: Systemd Reload Command
sudo systemctl reload docker
Method 2: Sending SIGHUP Signal Directly
sudo kill -s HUP $(pidof dockerd)
Inspect /var/log/syslog or journalctl -u docker to confirm signal reception:
systemd[1]: Reloading Docker Application Container Engine...
dockerd[1420]: time="2026-11-17T11:00:00Z" level=info msg="Got signal SIGHUP; reloading configuration."
Note: Parameters that alter core daemon infrastructure—such as
data-root,bip, orstorage-driver—require a full service restart (systemctl restart docker).
Takeaway: /etc/docker/daemon.json is the definitive source for daemon-wide policies. Always configure log rotation (max-size), enable live-restore: true for high availability, validate JSON syntax with jq, and use systemctl reload docker (SIGHUP) for zero-downtime updates.