I'm setting up a Jellyfin server using a Docker Compose file and I'm stuck on how to handle the data folder. Should I use a named volume (like - movies_volume:/very/important/data) or directly specify a path (like /example/path:/very/important/data)? I'm really concerned about losing important data over container restarts and host reboots. What do you all recommend?
4 Answers
I advise staying away from named volumes for crucial data. They can be accidentally deleted with commands like docker volume rm or system prune. It's safer to go with bind mounts, especially for data you can't afford to lose.
Backing up something that's directly bound to your disk is way easier. Named volumes can be a bit of a hassle; I find they complicate things.
I personally prefer using direct mounts. This way, I know exactly where my files are located, making backups simpler. Plus, if I need to edit a config file in the container, I can just do it right from the host without any hassle. I usually organize my directories under /persist/containername, so if I ever want to move my Jellyfin server to a new host, I just transfer the whole folder and I'm up and running in no time.
Honestly, it doesn't matter much since both options are stored on your local disk. The main difference is how Docker manages them. Some say named volumes are safer because Docker keeps them intact through updates, but with direct paths, you need to make sure your backup plans cover those specific locations. Me? I stick with named volumes for peace of mind. If you ever need to restore or migrate, it's a lot easier dealing with volume names instead of scrambling to find file paths.

Related Questions
How To Get Your Domain Unblocked From Facebook
How To Find A String In a Directory of Files Using Linux