No KYC · seven Linux VPS plans, one price in six cities · Pay in BTC, USDT, USDC, ETH, SOL, LTC, XMR
Language: English
Configure a VPS

Guide · backups · checked 16 November 2026

How do I back up a VPS?

Last updated: · 4 min read

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.

  1. Install restic

    Run apt install restic on Debian and Ubuntu, or dnf install restic from EPEL on AlmaLinux and Rocky Linux.

  2. 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 test ssh backup@backup-host.

  3. Store the repository password

    Put a long random password in /root/.restic-pass and run chmod 600 /root/.restic-pass. Keep a copy elsewhere: without it, the backups cannot be read.

  4. Create the repository

    Run restic -r sftp:backup@backup-host:/srv/restic --password-file /root/.restic-pass init.

  5. Dump databases first

    Run mysqldump --single-transaction --all-databases > /var/backups/mysql.sql, or pg_dumpall for PostgreSQL, so a consistent copy sits on disk.

  6. Run the backup

    Run restic -r sftp:backup@backup-host:/srv/restic --password-file /root/.restic-pass backup /etc /var/www /var/backups /home.

  7. Test a restore

    Run the same -r and --password-file options with restore 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.

restic and rsync compared as tools to back up a VPS
Featureresticrsync
Keeps old versionsYes, as snapshotsNo, unless you add dated folders or hard links
Encryption at restYes, alwaysNo
DeduplicationYesNo
TargetsLocal disk, SFTP, S3-compatible and othersLocal disk or SSH
Restorerestic restore or restic mountCopy files back
Best forDaily versioned backupsMirrors 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 --prune
  • restic check once 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)
  1. restic documentation — restic project (2026-11-16)
  2. rsync(1) manual — rsync project (2026-11-16)
  3. 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.

From $2.25/mo on 12 months · no KYC

Configure