I’m a (very) recent self-hoster. NixOS has made things incredibly easy, and suddenly I have forgejo, outline, victoriametrics+grafana and few other services setup, working via cloudflare tunnel absolutely beautifully. The Raspberry Pi 4B is a workhorse, and apparently even with all this idles at 3% CPU and 25% RAM usage.
But, even though it boots from and stores everything on an SSD with ext4, I’m weary of losing all the data stored. Particularly because some of the services are also used by a few friends.
So, all the data is scattered across a few places, under different users, and I’d like to establish a preferably central backup solution. I’d like to understand what options there are and the level of complexity and costs they involve.
Ideally I’d like to have:
All configuration by Nix
As little $$ expenditure as possible, but I can pay a few bucks a month
No babysitting (I understand the parts about testing backups, which I will)
Even if your solution does not fit the criteria, please feel free to mention anyway, TIA!
Since you aren’t using ZFS, Restic works quite well to backup several different sources to a common repository on Backblaze B2. I’m paying a couple USD a month for ~350 GB.
I can really recommend borg, it’s a great solution, though potentially a bit overwhelming if you only use the official docs.
If you want to support the development of it while paying for the storage, consider BorgBase instead of one of the big players. They’ve been very reliable for me for years, and actively contribute to borg itself and maintain a borg GUI client called Vorta. Their setup guides are also easy to follow.
I’m now seeing they offer hosting for Restic as well, so that’s nice.
For NixOS config, you can check out the wiki entry though I haven’t tried it out as I didn’t make the switch to NixOS yet.
Using a little bit of a mishmash of different things, which absolutely has to be replaced with something proper. Just found out about https://zfs.rent and am absolutely going to give that a go since everything I care about is synced to a NixOS host that uses ZFS.
Disclaimer: I have not actually tried zfs.rent yet.
ZFS snapshots make backups really convenient and efficient. I’m using ZFS with zrepl to take care of (local) snapshotting as well as syncing them to a remote host.
Late update, but I ended up creating an abstraction over services.restic. It backs up configured directories for individual machine, at selected time, keeps select number of snapshots.
I also ended up syncing created snapshots across machines via Syncthing. I know, not the best practice, but I have limited resources to spend money-wise.
Another good thing about the abstraction is it sends healthchecks pings that keeps track of how the backups are going so if something goes wrong I get alerted quickly.
So far pretty happy with how it ended up. In future I might set up automatic restore tests. In particular backup of postgres is badly setup, because it just backs up the directory instead of doing proper pgdump. This will fail when restoring, but unfortunately I don’t have time to get into that right now. If someone has recommendation on postgres backup that can be integrated with restic, I’ll be grateful.