Your VPS data is only as safe as your backup strategy. A single accidental rm -rf, an automated script gone wrong, or a provider-level failure can wipe out months of work in seconds. While many VPS providers offer snapshots, these are often tied to the provider’s infrastructure — if the provider goes down, so do your snapshots. This guide compares three modern, open-source backup tools — Rclone, BorgBackup, and Restic — that encrypt, deduplicate, and store your data offsite to a separate provider.
Why Offsite Backups Matter for Your VPS
Storing backups on the same VPS or even the same provider defeats the purpose of disaster recovery. If the provider suffers a datacenter outage, hardware failure, or account suspension, your backups are gone too. An offsite backup strategy means:
- Provider independence: Store backups on a different cloud provider (e.g., Backblaze B2, Wasabi, AWS S3)
- Ransomware protection: Immutable object storage prevents backup deletion by attackers
- Geographic redundancy: Backups in a different region survive regional outages
- Cost efficiency: Deduplication and compression reduce storage costs significantly
See our VPS provider comparison for options that include offsite backup storage at no additional cost.
Tool Overview
| Feature | Rclone | BorgBackup | Restic |
|---|---|---|---|
| Type | Cloud sync/copy | Deduplicating backup | Deduplicating backup |
| Deduplication | No (sync only) | Yes (chunk-based) | Yes (chunk-based) |
| Encryption | Client-side (crypt remote) | Built-in (AES-256-CTR) | Built-in (AES-256-GCM) |
| Compression | No | Yes (lz4, zstd, lzma) | Yes (built-in) |
| Supported Backends | 50+ (S3, B2, GDrive, SFTP, etc.) | Local, SFTP, remote via ssh | Local, SFTP, S3, B2, Azure, GCS, REST |
| Mountable Backups | Yes (read-only) | Yes (FUSE) | Yes (FUSE) |
| Learning Curve | Low | Medium | Low–Medium |
Tool 1: Rclone — Universal Cloud Sync
Rclone is the Swiss Army knife of cloud storage. It syncs and copies files to over 50 cloud providers. It does not deduplicate — each backup is a full copy of your files — but its breadth of supported backends and simplicity make it ideal for small VPS setups or configuration backups.
Setup and Usage
# Install
sudo apt install rclone -y
# Configure a remote (interactive)
rclone config
# Example: automatic config for Backblaze B2
# Run 'rclone config' and choose:
# - n) New remote
# - Name: b2-backup
# - Type: 4 (b2)
# - Enter your Backblaze Key ID and Application Key
# Sync a directory to B2 (first backup will be full)
rclone sync /var/www/html b2-backup:my-bucket/html --progress
# Sync with encryption (crypt remote overlay)
# Create a crypt remote pointing to b2-backup:my-bucket
rclone sync /var/www/html crypt-backup: --progress
# List snapshots/versions
rclone ls b2-backup:my-bucket
Automated Backup Script
#!/bin/bash
# /usr/local/bin/rclone-backup.sh
set -e
BACKUP_DIRS="/var/www/html /etc /home"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
REMOTE="crypt-backup:my-bucket/vps-backups/$TIMESTAMP"
for dir in $BACKUP_DIRS; do
echo "Backing up $dir..."
rclone sync "$dir" "$REMOTE$dir" --progress --bwlimit 10M
done
echo "Backup complete: $TIMESTAMP"
# Keep this in crontab:
# 0 3 * * * /usr/local/bin/rclone-backup.sh
Rclone also supports Backblaze B2’s lifecycle rules for automatic version cleanup and S3 Object Lock for immutable backups.
Tool 2: BorgBackup — The Deduplication Powerhouse
BorgBackup (formerly Borg) is a deduplicating backup tool that splits files into variable-size chunks and stores each chunk only once. This means that daily backups of a 50 GB database with 1% daily change add only ~500 MB to the repository per day after the initial full backup. Compression (zstd) further reduces storage by 2–4× on average.
Setup and Initialization
# Install
sudo apt install borgbackup -y
# Create a repository on a remote server (or local path)
borg init --encryption=repokey-blake2 /mnt/backup/borg-repo
# Or create on a remote server via SSH
borg init --encryption=repokey-blake2 user@backup-server:/path/to/repo
Create and Restore Backups
# Create a backup
borg create \
--verbose \
--filter AME \
--list \
--stats \
--show-rc \
--compression zstd,10 \
--exclude-caches \
--exclude '/var/cache/*' \
--exclude '/home/*/.cache/*' \
/mnt/backup/borg-repo::'{hostname}-{now:%Y%m%d-%H%M%S}' \
/var/www /etc /home
# List archives
borg list /mnt/backup/borg-repo
# Restore a specific archive
borg extract /mnt/backup/borg-repo::my-vps-20260717-030000
# Mount a backup as a FUSE filesystem
borg mount /mnt/backup/borg-repo::my-vps-20260717-030000 /mnt/restore
# Prune old backups (keep last 7 daily, 4 weekly, 6 monthly)
borg prune \
--verbose \
--list \
--keep-daily 7 \
--keep-weekly 4 \
--keep-monthly 6 \
/mnt/backup/borg-repo
Automated Borg Backup with systemd Timer
Create /etc/systemd/system/borg-backup.service:
[Unit]
Description=BorgBackup
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
Environment=BORG_REPO=/mnt/backup/borg-repo
Environment=BORG_PASSPHRASE=your-strong-passphrase
ExecStart=/usr/bin/borg create --compression zstd,10 --exclude-caches \
::'{hostname}-{now:%Y%m%d-%H%M%S}' /var/www /etc /home
ExecStartPost=/usr/bin/borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6
Nice=10
IOSchedulingClass=2
IOSchedulingPriority=7
Then /etc/systemd/system/borg-backup.timer:
[Unit]
Description=Run BorgBackup daily
[Timer]
OnCalendar=daily
RandomizedDelaySec=3600
Persistent=true
[Install]
WantedBy=timers.target
sudo systemctl daemon-reload
sudo systemctl enable borg-backup.timer
sudo systemctl start borg-backup.timer
Tool 3: Restic — Modern and Fast
Restic is a newer alternative to Borg with a focus on simplicity and native cloud storage support. It supports S3, Backblaze B2, Azure, Google Cloud Storage, and SFTP directly — no need for SSH tunnels or FUSE mounts. Like Borg, it deduplicates and encrypts data. Its main advantage over Borg is first-class cloud storage support without needing a separate SSH server.
Setup and Backup
# Install
sudo apt install restic -y
# Initialize a repository on Backblaze B2
restic init --repo b2:my-bucket:/restic-repo
# Set environment variables for automation
export B2_ACCOUNT_ID=your-key-id
export B2_ACCOUNT_KEY=your-app-key
export RESTIC_PASSWORD=your-strong-password
# Create a backup
restic --repo b2:my-bucket:/restic-repo \
--verbose \
backup /var/www /etc /home \
--exclude='*.log' \
--exclude='/var/cache/*'
Restore and Manage Snapshots
# List snapshots
restic snapshots --repo b2:my-bucket:/restic-repo
# Restore latest snapshot
restic restore latest --target /tmp/restore
# Restore a specific snapshot
restic restore 4a5b6c7d --target /tmp/restore
# Mount snapshots as a FUSE filesystem
restic mount /mnt/restic-mount
# Check repository integrity
restic check --repo b2:my-bucket:/restic-repo
# Forget old snapshots (keep policy)
restic forget --repo b2:my-bucket:/restic-repo \
--keep-daily 7 --keep-weekly 5 --keep-monthly 3 \
--prune
Comparison: Which Tool Should You Choose?
| Use Case | Recommended Tool | Why |
|---|---|---|
| Simple file sync to any cloud | Rclone | 50+ backends, simplest setup, no dedup needed for small data |
| Daily full VPS backups (50 GB+) | BorgBackup | Best dedup ratio (variable chunks), excellent compression, proven reliability |
| Backups directly to S3/B2/Azure | Restic | Native cloud support, no need for SSH or intermediate server |
| Database backups (MySQL, PostgreSQL) | BorgBackup or Restic | Dedup across sequential dumps saves enormous space |
| Low-disk VPS (<10 GB free) | Restic | Streams directly to cloud without local temporary storage |
| Config files + small data (<5 GB) | Rclone | Overkill to set up Borg for tiny datasets |
Recovery Testing: The Most Important Step
A backup you have never restored is not a backup — it is a hope. Schedule regular recovery tests:
#!/bin/bash
# /usr/local/bin/test-recovery.sh
# Run this monthly to verify backups
set -e
case $1 in
borg)
# Test Borg: verify archive integrity
borg check --verbose /mnt/backup/borg-repo
# Extract a small test file
borg extract --stdout /mnt/backup/borg-repo::latest etc/hostname > /dev/null
echo "Borg recovery test: PASS"
;;
restic)
# Test Restic: check repo
restic check --repo b2:my-bucket:/restic-repo
# Extract a test file
restic dump latest /etc/hostname > /dev/null
echo "Restic recovery test: PASS"
;;
rclone)
# Test Rclone: verify checksums
rclone check /var/www/html crypt-backup:my-bucket/html --size-only
echo "Rclone recovery test: PASS"
;;
esac
Run monthly: 0 5 1 * * /usr/local/bin/test-recovery.sh borg
Best Practices Summary
- Encrypt everything: All three tools support client-side encryption. Use it. A lost USB drive with backup data should not be a security breach.
- Use the 3-2-1 rule: Three copies, on two different media, with one offsite. For VPS users, this means: live data + on-VPS snapshot + offsite Borg/Restic backup.
- Monitor failures: Set up email or webhook alerts for backup failure. A silent failure that lasts weeks is worse than no backup at all.
- Test quarterly: Actually spin up a temporary VPS and restore everything. Measure the recovery time objective (RTO) for your setup.
- Version your backups: Keep enough history to recover from ransomware. If you discover an infection after 30 days, you need a snapshot from before that window.
Offsite backup storage does not need to be expensive. Backblaze B2 charges ~$6/TB/month, and Wasabi offers no-egress-fee storage. For more on selecting infrastructure that integrates well with your backup strategy, see our VPS provider comparison.

Leave a Reply
You must be logged in to post a comment.