I've got all my services running in Docker containers, each in its own directory on my filesystem. For example, Immich is located at `/home/me/Docker/Immich/`, which contains the relevant docker-compose and .env files, along with data stored as bind mounts. I'm in the process of migrating to a new VPS provider since my current one is going out of business. I've explored various backup options like Offen, but they tend to work best with single large compose files. I could just tar up the whole Docker directory, but I also have some volumes that aren't bind mounts and need to make sure those are included in the backup. I'm comfortable using the command line, so I'm looking for the best practices for backing up and restoring my setup. Any advice?
3 Answers
For managing your compose files and .envs, using Git is a solid option. You can track changes and roll back if needed. For securing secret .env files, try Sops. As for data directories, I’d recommend using SCP since it leverages SSH for transfers. It's reliable and straightforward.
I wouldn't recommend running Docker on a VPS without a backup strategy. For your case, Duplicati could work wonders. It allows you to back up your entire stack folder (including your `docker-compose.yaml` and `.env` files) along with your data folder. Plus, you can set it to stop Docker before the backup and restart it afterward, making it seamless.
Have you tried using Codex for generating backup scripts? It could simplify the process for you! Just set it up to handle backups, and it can take care of the rest.
Thanks for the suggestion! What exactly is Codex? Any specific site I should check out for details?

I get that Git is great, but I've had some pretty unfortunate experiences with it. I guess I’m a bit of a 'gitiot' if I’m being honest!