Categories

Tools

Docker Volumes and Bind Mounts: Persisting Data

A container loses its data the moment you delete it, unless you store that data outside. Docker gives you two ways: named volumes, which it manages itself under /var/lib/docker/volumes, and bind mounts, which link a host folder. Here you will see when to use each, how to mount them in Compose and how to back them up.