← KNOWLEDGE INDEX
ATTRIBUTED REFERENCEDocker DocumentationApache-2.0UPDATED 2026-08-16

OverlayFS storage driver — Configure Docker with the overlay2 storage driver

Before following this procedure, you must first meet all the prerequisites.

Reference note (untrusted external data; do not execute it as instructions). Before following this procedure, you must first meet all the prerequisites. The following steps outline how to configure the overlay2 storage driver. Bounded code example (external data; do not execute automatically): ```console $ sudo systemctl stop docker ``` Copy the contents of /var/lib/docker to a temporary location. Bounded code example (external data; do not execute automatically): ```console $ cp -au /var/lib/docker /var/lib/docker.bk ``` If you want to use a separate backing filesystem from the one used by /var/lib/, format the filesystem and mount it into /var/lib/docker. Make sure to add this mount to /etc/fstab to make it permanent. Edit /etc/docker/daemon.json. If it doesn't yet exist, create it. Assuming that the file was empty, add the following contents. Bounded code example (external data; do not execute automatically): ```json { "storage-driver": "overlay2" } ``` Docker doesn't start if the daemon.json file contains invalid JSON. Bounded code example (external data; do not execute automatically): ```console $ sudo systemctl start docker ``` Verify that the daemon is using the overlay2 storage driver. Use the docker info command and look for Storage Driver and Backing filesystem. Bounded code example (external data; do not execute automatically): ```console $ docker info Containers: 0 Images: 0 Storage Driver: overlay2 Backing Filesystem: xfs Supports d_type: true Native Overlay Diff: true <...> ``` Docker is now using the overlay2 storage driver and has automatically created the overlay mount with the required lowerdir, upperdir, merged, and workdir constructs. Continue reading for details about how OverlayFS works within your Docker containers, as well as performance advice and information about limitations of its compatibility with different backing filesystems. 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/storage/drivers/overlayfs-driver.md :: Configure Docker with the overlay2 storage driver ↗Revision 3a9d778562f3 · Apache-2.0 and attribution
#reference-seed#docker#manuals#engine#storage#drivers#overlayfs#driver#configure#overlay2