Common practice for backing up Containers that include data and configuration reddit / selfhosted ---------------------------------------------------------------------- RevolutionaryHunt753 · 2023-10-03 17:24 I am new to Portainer and planning to deploy and using it. I will be hosting my Portainer and VMs in a Proxmox VM. Many containers that I will be managing through Portainer will include configuration or data. What are the common practice for backing up Containers that include data and configuration? ​ ---------------------------------------------------------------------- ElevenNotes · 2023-10-03 18:26 https://github.com/camptocamp/bivac ---------------------------------------------------------------------- Zealousideal_Corgi22 · 2023-10-03 19:00 I typically just bindmount the folder where the data is stored and then I just backup the folder. I'm not sure if there's a benefit to keeping your data on volumes ---------------------------------------------------------------------- Spuxilet · 2023-10-03 19:31 I am using this script which uses portainer API to stop all runing stacks. [https://pastebin.com/A82YdhCD](https://pastebin.com/A82YdhCD) I have simple bash script that: 1 stops local containers and docker service 2 stops remote containers and docker service 3 rsyncs remote docker root dir into my local docker dir and external storage 4 starts portainer local and remote (which also starts docker service automatically) and all stacks i have defined to startup in that pastebin python script. ---------------------------------------------------------------------- RevolutionaryHunt753 · 2023-10-03 19:37 >I'm not sure if there's a benefit to keeping your data on volumes Then where do you keep configuration files, or data files, or MySQL database files? ---------------------------------------------------------------------- Stetsed · 2023-10-03 20:45 So I use bind mounts for all data storage, and then I have a script that stops the container, tars it while preserving all extra attributes such as ownership, ACL etc and then starts the container. Then it uploads this tar to my S3 storage that's hosted using GarageHQ which includes an off site backup location. And 2 nodes inside of my homelab. ---------------------------------------------------------------------- Stetsed · 2023-10-03 20:46 Bindmounts are similar to volumes but instead of defining your volumes in docker you dedicate a path. So for example in docker compose I would set ./sonarr-config:/config/path this makes it really easy to transfer and do stuff with it as it's all done inside of the docker compose folder instead of some volume which is stored somewhere over the rainbow ---------------------------------------------------------------------- PkHolm · 2023-10-03 21:03 All configure shoulbe external to containers, so you should be able to rebuild any container without backup. Data backups are done by temporary containers either by mounting same volumes as work container. or in case when file level backup does not work ( SQL dB is prime example), temporary container will connect to DB run sqldump and than back it up. If you run anything on host itself your are doing it wrong. Bind mounts also bad practice, host should be 100% disposable ---------------------------------------------------------------------- DeineZehe · 2023-10-03 22:51 While slightly more complicated the premiere way to manage and backup config files is in my opinion a selfhosted gitlab/gitea instance with a ci /cd provider. This way whenever you commit a file to a repo a new service gets created automatically. Then you only have to backup the repo. I’m using agrocd kubernetes ---------------------------------------------------------------------- martinfgar · 2023-10-04 13:28 Bindmount and restic + rclone to upload the backup to drive. Then I just use a bash script to backup once a day.