Linux

Where Does Docker Store Images and Volumes?

Docker keeps images, containers, and volumes under /var/lib/docker by default. Change it with data-root in daemon.json, then migrate contents.

Last updated

Docker data-root is the heaviest folder on many servers. Images, container writable layers, named volumes, networks, and build cache all pile under one directory, easily tens of gigabytes. The default sits on the root filesystem, which fills exactly when you can least afford it.

The daemon.json data-root key relocates the whole tree to a bigger disk. Volumes deserve separate thought: they hold the state that matters while images stay disposable. Prune regularly, since dangling layers accumulate silently behind every rebuild.

Where Docker Engine stores this, by platform

Linux
/var/lib/docker/

Images, containers, volumes, and build cache together. Relocate via data-root in daemon.json with the daemon stopped. Back up named volumes with services stopped.

Frequently asked questions

How do I move Docker storage to another disk?

Stop the daemon, copy the directory to the new disk preserving permissions, point data-root at it in daemon.json, and restart. Skipping the copy orphans every image and volume. Verify with docker info before deleting the old folder.

What must I back up before reinstalling?

Named volumes under the volumes tree hold database and upload data; bind mounts live wherever the compose file points. Back up volumes with the service stopped. Image layers rebuild from Dockerfiles, but volume contents never do.

Notice an outdated path? Let us know.