I recommend several layers of backups, depending on the way you’re deploying things.
First, Virtualmin backups. This backs up individual virtual servers. These backups can be used to move a single account to another server, or restore it to a known-good state in the event of a mistake or exploit. These should end up somewhere off-system (to protect against flood, fire, disk failure, root exploit). https://www.virtualmin.com/docs/data-operations/how-to-backup-virtual-servers/
Next, config file backups. Many ways to do this. I use/recommend etckeeper, so you have a git history of all changes to /etc
; this can be a little temperamental, so you may have to babysit it a little bit if it stops being able to update automatically, but nothing is better than a git history of every change to every configuration…rolling back any change becomes possible. You probably also want just a static backup now and then that goes to another system, for cases where something catastrophic happens to the server itself (again, disk failure, root exploit, flood, fire, etc.). Webmin has a tool for backing up all the config files it manages: Backup Configuration Files | Webmin or you can just ssh
the entire /etc
directory to somewhere safe periodically (or rclone
it to a s3 bucket, whatever, many options).
If you have a “golden image” that you deploy to all new servers, with your exact configuration and software (i.e. already has Virtualmin installed, and all services configured how you like), you can stop there…you won’t need to worry about the other stuff. Many people who don’t have a standard install just do Virtualmin backups and config file backups, and plan to just install Virtualmin on a fresh system with the same OS and version and restore the relevant configuration files (not the ones Virtualmin modifies per domain, though, like `virtual) in the event they have a catastrophic failure. That can work, too, but the easiest disaster recovery is probably a full filesystem backup. Many ways to do that.
One option is the Webmin Filesystem Backup module: Filesystem Backup | Webmin
If you only do one thing today, start using Virtualmin backups for your domains. It only takes a few minutes to setup and is easy to backup to S3 buckets or whatever (which can be quite cheap, Amazon is among the most expensive S3 options and even it’s quite cheap…but BackBlaze and some others have S3 compatible storage that’s even cheaper, you can shop around, but don’t let perfect be the enemy of the good, get your backups happening immediately). That alone can restore most things even on a freshly installed OS with Virtualmin installed. The important stuff is usually user data, unless you have a bunch of really critical custom configuration.
If you search the forum for backup discussions you’ll find people discussing use of rclone
, rsync
, full-featured system backup tools, etc. I don’t care how you backup your systems, as long as you’re backing them up and testing that you can restore them in a timely manner (and selectively, it’s useful to be able to pick out one file without having to roll the whole system back to the last backup).