Hi Everyone
I need some help
I’m currently selfhosting some of my applications on Digital Ocean and i run a container using Portainer CE. I was wondering how you guys keep backups for the applications running on docker.
I’m currently using Digital ocean’s snapshots feature but is there a better way i could use, any help on this is highly appreciated.
For databases and data I use restic-compose-backup because you can use labels in your docker compose files.
For config files I use a git repository.
On Proxmox i use for my Backup Solution - Hetzner Storage Bix
I use Kopia. The cli is very easy to use and I have backups scheduled nightly. I backup all external mounts and my entire Portainer directory. Has helped in a pinch to restore busted databases.
I point Kopia cli to backup to a WebDAV location I host on my NAS. For off-site backups I run daily backups of that kopia repository to Google cloud.
I’m not sure if Google cloud is the best off-site backup solution, but I did a price comparison when I first selected it and it was the best capacity for the price that I could find at the time.
Use resticker to add an additional backup service to each compose allowing me to customize some pre/post backup actions. Works like a charm 👍
I backup all the mounted docker volumes once every hour (snapshots). Additionally i create dumps from all databases with https://github.com/tiredofit/docker-db-backup (once every hour or once a day depending on the database).
When backing up Docker volumes, should not the docker container be stopped first.?? I can’t se any support for that in the backup tools mentioned.
Yes the containers do need to be stopped. I actually built a project that does exactly that.
Thanks, I will look into this.
I use Nautical. It will stop your containers before performing an RSYNC backup.
I have bind mounts to nfs shares that are backed my zfs pools and last snapshots and sync jobs to another storage device. All containers are ephemeral.
A few hard drives that are stored offsite and rotate every few weeks.
duplicati to take live, crash-consistent backups of all my windows servers and VMs with Volume Shadowcopy Service (VSS)
ZFS snapshots.
Borgbackup, borgmatic to two backup targets: one in my home and a Hetzner Storage Box. Amongst other things, i include /var/lib/docker/volumes, covering the not-filesystem-bound mounts.
What retention do you run?
I’m setting up the same system, but don’t know how far back I need. Currently considering 7 daily backups, so I can restore to any point within the week, and 2-3 Monthly backups in case there’s an issue I miss for a real long period.entirely up to your feelings i guess - i run 7 dailies and 2 weeklies
Most of mine are lightweight so private repos on git.
For big data I have two NAS that sync on the daily.
Cronjobs to backup important folders to a separate disk
Git repo(s) for services & configs with weekly automated commits and pushes
I do the reverse… all configs are ansible scripts and files and I just push them to the servers. That way I can spin up a new machine from scratch, completely automated within minutes… just the time it takes the machine to set itself up.
I use docker in Proxmox and i backup all container
I use an Ubuntu vm for all my containers in proxmox and make backups of the vm onto my zfs pool