How to Store VPS Backups Off-Site So One Server Failure Does Not Wipe You Out
A backup that lives on the same VPS it protects is not a backup. It is a copy sitting next to the original, exposed to the same disk failure, the same deleted directory, and the same compromised account. If you want to store vps backups off-site, you need a second location, a repeatable process, and a restore you have already tested. This guide covers the setup that works for a single VPS: encrypted backups, storage outside your server, automation, retention, and a restore test.
Start with the 3-2-1 backup rule. Keep three copies of your data, on two different types of storage, with one copy off-site. For a single VPS, that means the live data, a local copy for fast recovery, and an encrypted off-site copy. A longer walkthrough for one server is in our guide to the off-site backup strategy for a single VPS and the 3-2-1 rule.
How to store VPS backups off-site in practice
The flow has four parts. First, choose an off-site target that is separate from your VPS provider when possible. Second, encrypt the backup before it leaves the server. Third, run it on a schedule and keep the logs. Fourth, restore from it on a test machine and confirm the files open. Skip any one of those parts and the chain breaks at the worst moment: an unencrypted backup leaks data, an unscheduled backup goes stale, and an untested backup may restore nothing.
Separate the backup credentials from the server credentials too. The key that can read and delete your backups should not sit next to the root password, and it should not have more access than it needs. Use a dedicated bucket, a token scoped to that bucket, and a repository password stored outside the server, for example in a password manager.
Pick your off-site storage
Most single-VPS owners pick one of four off-site backup storage options. S3-compatible object storage works well with restic and rclone, and it scales without managing another server. A storage box is simpler if you prefer SSH and rsync. A second VPS in another region also works, but you then have a second server to maintain and patch.
| Option | Good for | Watch out for |
|---|---|---|
| Backblaze B2 | S3-compatible storage, pay for what you use | Egress and API costs; check official pricing |
| Cloudflare R2 | S3-compatible storage, no egress fees for downloads in many cases | Storage and request pricing still apply; check official pricing |
| Hetzner Storage Box | Fixed monthly storage, SSH and rsync access | Fixed size; pick a size above your backup set |
| Second VPS | Full control, separation from the first provider | You maintain and patch a second machine |
Cost depends on how much data you store, how often it changes, and how often you download it. Estimate your backup size first, then compare providers on storage, egress, and request pricing. Our comparison of AWS S3, Backblaze B2, and Cloudflare R2 for off-site backup storage walks through those trade-offs.
Set up encrypted backups with restic
Restic encrypts the backup on your VPS before upload, so the storage provider only sees encrypted chunks. A restic backup to s3 needs a repository URL, an access key, a secret key, and a repository password. Set the password with an environment variable or a password file, and keep it somewhere safe. Losing it means losing the backups.
Install restic from your distribution packages or the official release, then initialise the repository once:
export RESTIC_REPOSITORY="s3:https://s3.eu-central-003.backblazeb2.com/your-bucket-name"
export RESTIC_PASSWORD_FILE="/root/.restic-password"
restic init
Replace the endpoint and bucket name with your own. The endpoint above is an example for one Backblaze region; your provider will give you the correct endpoint. After the repository exists, back up the directories that matter:
restic backup /etc /var/www /home --exclude /var/www/*/cache
Restic backs up files, not a live database, so dump MySQL or PostgreSQL to a file first, then include that file. For MySQL, mysqldump writes a single SQL file. For PostgreSQL, pg_dump does the same. Keep the dump inside a directory that restic backs up.
If you prefer rclone or rsync, the same principle holds: encrypt first or use a target you trust. Rclone can copy a directory to S3-compatible storage with one command:
rclone sync /var/backups remote:your-bucket-name --progress
Rsync works well for a storage box over SSH:
rsync -a --delete /var/backups/ user@your-storage-box:/backups/
Use --delete only when you are sure the source directory is complete. It removes files on the target that no longer exist on the source, which is what you want for a mirror, and exactly what you do not want if the source was emptied by mistake.
Automate it and set retention
A backup you run by hand will stop running. Put it in cron and log the output so you can see failures. A nightly run after your lowest-traffic hour works for most small servers. Here is a cron entry that runs a backup script at 02:30 every day:
30 2 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1
Put the restic commands in /usr/local/bin/backup.sh, make it executable with chmod +x, and have it dump the database, run restic, then prune old snapshots. Restic retention uses restic forget with --keep-daily, --keep-weekly, and --keep-monthly. A common starting point is seven daily, four weekly, and six monthly snapshots:
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
That is a backup retention policy you can explain in one line, and it keeps storage growth under control. Adjust the numbers to your disk budget and to how far back you might need to go.
Check the log at least weekly. A cron job that fails silently is the same as no backup. Look for three things: the backup finished without error, the snapshot size looks normal, and the prune step ran.
Test the restore before you need it
List your snapshots, then restore one to a separate directory on a test machine or a temporary VPS. Do not restore over the live data to test.
restic snapshots
restic restore latest --target /tmp/restore-test
Open the restored files. Check that the website files are complete, the database dump imports, and the configuration files are present. A restore test that only checks that files exist is not enough. The full method is covered in our guide to testing backup restores without breaking production.
Run a restore test after any change to the backup set, and at least once a quarter. When you add a new site or database, add it to the backup script the same day. The most common restore failure is not a corrupt snapshot. It is a directory that was never in the backup set.
What to back up, and what to skip
Back up the data you cannot rebuild: website files, uploads, database dumps, configuration in /etc, and the small files that hold secrets and settings, such as environment files and web server configs. Keep a note of the software versions too. On Debian or Ubuntu, dpkg --get-selections writes a list of installed packages to a file you can include in the backup.
Skip caches, logs, and temporary files. They are large, they change constantly, and they add nothing to a restore. Exclude them in the restic command or in an exclude file, and review the exclude list when the site changes. If you want the full step-by-step for restic with S3-compatible storage, see our guide to backing up a VPS to S3-compatible storage with restic.
Frequently asked questions
How often should I back up a VPS off-site?
Daily is the right default for a site that changes every day. If the site rarely changes, weekly may be enough, but the gap between backups is the data you lose when the server fails. Match the schedule to how much new content, orders, or user data you can afford to lose, then automate it so the schedule holds.
Is one off-site copy enough?
One off-site copy plus the live data covers the common failures: a dead disk, a deleted file, or a lost server. It does not cover a bad backup, a lost repository password, or a storage account problem. Keep a second off-site copy or a longer retention window if the data matters enough that one failure in the backup chain would hurt.
Should I encrypt backups before sending them off-site?
Yes. Encrypt on the VPS before upload, with a tool like restic, so the storage provider never sees your files in plain text. Store the repository password separately from the server, and test that you can open the repository with it. An encrypted backup you cannot unlock is the same as no backup.