What's the Best Way to Back Up Your Docker Setup?
Asked by
!orbitFit
I've set up my Docker environment with a `docker-compose.yml` file and a folder for volumes. I want to know the most effective method to back this up so I can easily transfer everything to another operating system and have it work seamlessly. Any suggestions on what to include in the backup?
Answers
I rely on Docker Compose files stored in a git repository, and use bind mounts for any data that isnโt ephemeral. It's a straightforward way to manage backups.
Reply to this answer
For anything that needs backing up, I use bind mounts and keep them organized in a single folder, with one directory for each service. I also save a copy of each compose file. Personally, I don't bother backing up volumes since containers are meant to be ephemeral. I've always used bind mounts, so I haven't seen a need to switch to volumes myself, but to each their own!
Reply to this answer
For my config files, I sync them to Google Drive using rclone, which lets me filter out certain types of files and directories. I donโt back up databases to Google since Iโm okay with losing those, but for critical information, I might reconsider. I also sync everything to a low-powered Synology server in my home, and I've been talking with a friend in the homelab community about doing encrypted syncs between our servers.
Reply to this answer
I've installed Docker on a Proxmox Debian VM, and I back up the entire VM using Proxmox's backup feature. I also save my Docker Compose files separately with Portainer backup.
Reply to this answer
I use Dokploy to handle my setup, and it offers great options for backing up volumes and databases to S3, either manually or on a schedule. It makes the whole process much simpler!
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions