Where are Docker volumes physically stored?
Docker volumes are physically stored on the host machine, outside the containers - usually in the directory:
javascript
/var/lib/docker/volumes/Each volume is a separate directory with service metadata and the real data. The container simply mounts this directory inside its own file system.
How this is arranged
- Docker stores all volumes in its own system folder (by default
/var/lib/docker/volumes/). - Each volume has its own folder with a unique ID.
- Inside it there is a
_datasubdirectory, which holds the application's actual files.
Example structure:
javascript
/var/lib/docker/volumes/
└── my_volume/_data/ <-- the real data is hereHow to view volumes
bash
docker volume lsHow to find the path to a specific volume
bash
docker volume inspect my_volumeThe Mountpoint field shows the actual path on disk.
Summary: data from volumes is stored on the host, usually in /var/lib/docker/volumes/, and the container accesses it through a mount point. Thanks to this, the volume outlives any container.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.