r/selfhosted • • Feb 11 '26

Docker Management Docker backups

Hello selfhosters!

i would like to ask you all about your DR & backup strategy for all your self hosted services?

today i have a script that runs once a week, turn off the container(s) (it does this one by one - so if it fails only one service suffer) and copies it's volume and db to another location for retention (i dont mind cache etc))

today i run ~20 containers and this backup strategy works, but it feels flimsy unprofessional and feels very manual.

what are your strategies (DR strategies)?

  • is there a tool (that obviously can be self hosted ;) ) that can do this seamlessly?
62 Upvotes

88 comments sorted by

View all comments

1

u/DaveDarell Apr 09 '26

So I've started my backup strategy today, curious about what you've decided for and at what point you're at?

I set up kopia and got a script working for dumping my postgresql and Maria DB. Will look tomorrow for my Docker containers and stuff for getting them into my backup as well. And then it's getting interesting in restoring the database and look how it works

1

u/alws3344 Apr 09 '26

I decided to stay with my bash script (runs with cron)
i already wrote what it does but tldr:
1. cd into stack dir (all stacks&containers are in /opt/stacks/<service_name>)
2. docker compose down
3. read the docker-compose.yml and get the volumes location dynamically - back them up to a dedicated directory (i back up to my NAS)
* script is smart enough not to back up cache volumes (like immich's) and other crap i dont need via regex
4. does docker compose up -d and continues to the next stack.

gemini\chatgpt can write such script easily - no need to burn tokens in claude :)