Understanding Docker Volumes vs. Bind Mounts

Why do containers eat your data on updates? Bind mounts vs volumes explained, the path syntax that matters, and the :ro trick to protect your media.

The #1 Mistake Beginners Make

Docker containers are disposable. If you update an application, the old container is deleted and a new one is created. If you haven’t mapped your data to your host hard drives, all your data is deleted with it.

Bind Mounts (The Best Way for Media)

A bind mount maps a physical folder on your hard drive to a folder inside the container.

Syntax: HOST_PATH : CONTAINER_PATH

In my server, I map my 1TB HDD directly to the Immich container, and my 2TB HDD directly to Jellyfin.

volumes:
- /mnt/2TB_drive/movies:/data/movies:ro

The :ro at the end means “Read-Only”. Even if Jellyfin glitches, it physically cannot delete my movie files.

Note

Folders that start with ./ in a Compose file (like ./jellyfin-config) are relative bind mounts. My Docker Compose template uses that pattern for every config folder.

Portrait of Guillermo

Written by Guillermo

IT Student & Home Server Enthusiast

Building private clouds to break free from Big Tech. I document everything I learn about home servers and self-hosting on MyHomeServerGuide.

More about the author