Quick answer
How do I back up a VPS?
To back up a VPS, dump each database to a file, then use restic to send encrypted, versioned snapshots of your data and configs to another machine, schedule it daily and test a restore. No SaltVPS plan includes backups, so a second server in another of the 6 cities, or any SFTP or S3 storage, holds the copies.
In brief
- Tool: restic, free, encrypted, deduplicated and versioned.
- Where: off the server: another VPS over SFTP, or S3-compatible storage.
- What: databases as dump files, then
/etc, web roots, app data and home folders. - When: daily, with old snapshots thinned by
restic forget --prune. - Proof: a backup counts only after a restore works.
How do you back up a VPS with restic?
Run as root. The repository here is a second server reached over SFTP with an SSH key.
Install restic
Run
apt install resticon Debian and Ubuntu, ordnf install resticfrom EPEL on AlmaLinux and Rocky Linux.Set up SSH to the backup host
Create a key with
ssh-keygen -t ed25519, add its public half to the backup user on the second server and testssh backup@backup-host.Store the repository password
Put a long random password in
/root/.restic-passand runchmod 600 /root/.restic-pass. Keep a copy elsewhere: without it, the backups cannot be read.Create the repository
Run
restic -r sftp:backup@backup-host:/srv/restic --password-file /root/.restic-pass init.Dump databases first
Run
mysqldump --single-transaction --all-databases > /var/backups/mysql.sql, orpg_dumpallfor PostgreSQL, so a consistent copy sits on disk.Run the backup
Run
restic -r sftp:backup@backup-host:/srv/restic --password-file /root/.restic-pass backup /etc /var/www /var/backups /home.Test a restore
Run the same
-rand--password-fileoptions withrestore latest --target /root/restore-test, then compare a few files.
Should you use restic or rsync to back up a VPS?
rsync copies; restic keeps history. Many setups use rsync for speed and restic for safety.
| Feature | restic | rsync |
|---|---|---|
| Keeps old versions | Yes, as snapshots | No, unless you add dated folders or hard links |
| Encryption at rest | Yes, always | No |
| Deduplication | Yes | No |
| Targets | Local disk, SFTP, S3-compatible and others | Local disk or SSH |
| Restore | restic restore or restic mount | Copy files back |
| Best for | Daily versioned backups | Mirrors and server-to-server moves |
How do you schedule and thin out backups?
Put the dump and backup commands in a small script and run it from cron each night. For example, in root's crontab (crontab -e): 30 3 * * * /root/backup.sh. In the script, after the backup, add retention:
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prunerestic checkonce a week, to verify the repository
Set RESTIC_REPOSITORY and RESTIC_PASSWORD_FILE at the top of the script so each command stays short.
Where should VPS backups live?
Anywhere but the server itself, ideally in another data centre. A disk failure, a bad command or a reinstall would take an on-server copy with it. SaltVPS checked its plan list on 16 November 2026: none of the 7 plans includes backups, and a reinstall erases the disk.
One simple setup: a production server in Frankfurt and a Grain (40 GB NVMe) in Amsterdam as the restic target, at $2.25 a month on 12 months. Plans with larger disks are on the pricing page. Restrict the backup user to SFTP and its own folder.
What is the best way to back up a VPS in 2026?
Follow the 3-2-1 idea: three copies, two kinds of storage, one far away. For a single server, that means the live data, a restic repository on another server, and a second repository or an occasional download at home. restic can copy snapshots between repositories with restic copy.
Backups also make moving easy: the migration guide restores a site on new hardware. Pair backups with the rest of the Linux VPS security guide.
VPS backup questions
Does SaltVPS take snapshots of my server?
No. No plan includes backups or snapshots, so keep your own copies off the server.
What should I back up on a VPS?
Database dumps, /etc, web roots, app data folders, Docker volumes and home folders. The operating system itself can be reinstalled.
How do I back up Docker volumes?
Stop or pause the app, or dump its database, then back up the volume folder under /var/lib/docker/volumes with restic.
Can I back up a VPS to my home computer?
Yes. Run restic or rsync from home over SSH, or download a restic repository regularly.
How often should I test a restore?
After the first backup, then every few months or after any change to the backup script.
Verdict
- Back up a VPS with daily restic snapshots stored on another machine.
- Dump databases first and test a restore; untested backups are only hope.
Sources (3)
- restic documentation — restic project (2026-11-16)
- rsync(1) manual — rsync project (2026-11-16)
- mysqldump reference — Oracle MySQL (2026-11-16)
A second server for your backups
Grain gives 40 GB NVMe in any of the 6 cities, a good off-site restic target.
- Built by a person, 1 hour at most after confirmation
- Lost days credited back if a server cannot be delivered
- Pay in BTC, XMR, USDT, USDC, ETH, SOL or LTC
- DomaineGoat LLC · Panama