Docker back-up strategy reddit / selfhosted ---------------------------------------------------------------------- shaunjanssens · 2023-11-28 15:56 I know, and read, a lot of posts here about backing up Docker volumes and data. The problem is that everyone has different setup, context and needs. So I need some help deciding what is best (and easy to manage) solution for my use case. My setup is fairly simple. I only use docker compose files, have one service per directory and all services are using named volumes. Some have `driver: local` to mount a local folder with config (always located in the same directory of the service). Each `docker- compose.yaml` file has a backup container which is `offen/docker- volume-backup` to backup the volumes. These backups are stored in a different folder (the same for all backups `/media/storage/backups/`). I also have a service with Duplicati to backup the volume backups and some extra data (Nextcloud) to a remote server. The reason why I use `offen/docker-volume-backup` is to shut down some containers for extra safety but I'm not sure I actually need this because I'm the only user and I'm not planning on opening my server for other user. Before I implemented docker-volume-backup and Duplicati all containers used bind mounts because that's less abstract for me, to actually see the files. Now, my question is: is this a good setup? Is there an easier setup with less components/steps? Is it, for example, also good if I go back to bind mounts and just backup everything with Duplicati when I'm asleep at night? Thank you for all the great advise! ---------------------------------------------------------------------- Leolele99 · 2023-11-28 19:01 offen docker-volume-backup actually works fine with bind mounts. I have been using it as my backup solution, backing up locally and to a backblaze s3 storage every night, pruning backups that are older than a week. I like it because it allows me to shutdown containers & execute commands, like dumping a sql database before backup. Setting it up with proper Telegram Notifications is also great, as I always know when my backups fail or grow in size too large due to configuration errors. ---------------------------------------------------------------------- rogierg · 2023-11-29 08:43 Why backup the docker volumes? What I do is bind mounts for config and data to a local directory and only backup that. Recovery then is as simple as spinning up the new containers and point to the local directories and I 'm up and running. ---------------------------------------------------------------------- Budget-Supermarket70 · 2023-11-29 13:01 Same as others have all my volumes in one directory. Then tar gzip and gpg encrypt it. Then send it to the cloud. Prune anything older then 30 days to reduce size. ---------------------------------------------------------------------- shaunjanssens · 2023-12-03 22:29 Thank you for your advice! I changed my setup to use bind mounts instead of named volumes and also added all `docker-compose.yaml` files to a single `docker-compose.yaml` file with `include`. Every night all container data is backed up locally and to a Hetzner filestorage. I also tested the backup and restore and it works great! I will setup notifications as well! ---------------------------------------------------------------------- shaunjanssens · 2023-12-03 22:31 I changed my setup to use bind mounts and it works great indeed! Just like you I now have a seperate folder for all config and data. I tested the restore process and it's very easy! ---------------------------------------------------------------------- rogierg · 2023-12-06 19:10 Glad it worked for you!