Docker daemon configuration overview
This page shows you how to customize the Docker daemon,
This page is for users who've installed Docker Engine manually. If you're using Docker Desktop, refer to the following pages instead:
There are two ways to configure the Docker daemon:
- Use a JSON configuration file. This is the preferred option, since it keeps all configurations in a single place.
- Use flags when starting
You can use both of these options together as long as you don't specify the same option both as a flag and in the JSON file. If that happens, the Docker daemon won't start and prints an error message.
The following table shows the location where the Docker daemon expects to find the configuration file by default, depending on your system and how you're running the daemon.
|OS and configuration
|Linux, regular setup
|Linux, rootless mode
For rootless mode, the daemon respects the
XDG_CONFIG_HOME variable. If set,
the expected file location is
You can also explicitly specify the location of the configuration file on
startup, using the
dockerd --config-file flag.
Learn about the available configuration options in the dockerd reference docs
You can also start the Docker daemon manually and configure it using flags. This can be useful for troubleshooting problems.
Here's an example of how to manually start the Docker daemon, using the same configurations as shown in the previous JSON configuration:
$ dockerd --debug \
Learn about the available configuration options in the dockerd reference docs, or by running:
$ dockerd --help
The Docker daemon persists all data in a single directory. This tracks everything related to Docker, including containers, images, volumes, service definition, and secrets.
By default this directory is:
You can configure the Docker daemon to use a different directory, using the
data-root configuration option. For example:
Since the state of a Docker daemon is kept on this directory, make sure you use a dedicated directory for each daemon. If two daemons share the same directory, for example, an NFS share, you are going to experience errors that are difficult to troubleshoot.
Many specific configuration options are discussed throughout the Docker documentation. Some places to go next include: