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?
5 Answers
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!
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.
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.
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!
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.

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