# How do you back up a VPS?

> How to back up a VPS with restic or rsync to a second place: nightly snapshots, 7 daily copies kept, and a restore test.

- URL: https://jadekvm.com/guides/how-to-back-up-a-vps/
- Last updated: 2026-11-16
- Publisher: JadeKVM (https://jadekvm.com)

This is how to back up a VPS when the host includes no backups, with restic or rsync, on Debian 13 or Ubuntu 24.04.

**Quick answer — How do you back up a VPS?**

To back up a VPS, dump the databases, then copy /etc, /home, /var/www and the dumps to another place with restic or rsync every night, keep 7 daily copies and test a restore. **JadeKVM** includes no backups in any plan, so this job is yours. A second server in another city works well.

**In brief**

- **Not included**: JadeKVM plans carry no backups, so copy data off the server.
- **restic** encrypts, deduplicates and keeps snapshots over SFTP.
- **Another place**: a second server, ideally in a different city, or object storage.
- **Test restores**: a backup you never restored is a hope, not a plan.

## How to back up a VPS in 6 steps?

The example sends restic snapshots over SFTP to a second server called backup-host.

1. **Pick the destination** — Use a second server or storage in another city, reachable over SSH.
2. **Install restic** — Run sudo apt install restic on the server you protect.
3. **Create the repository** — Write a password to /root/.restic-pass and run restic init on the SFTP target.
4. **Dump the databases** — Write a nightly mariadb-dump or pg_dump file before each backup.
5. **Schedule the backup** — Run restic backup and restic forget from a systemd timer every night.
6. **Test a restore** — Restore the latest snapshot to /tmp/restore and open a few files.

## Which is better for a VPS backup: restic or rsync?

*restic and rsync compared for backing up a VPS to another place*

| Point | restic | rsync | Winner |
| --- | --- | --- | --- |
| History | Many snapshots, deduplicated | One mirror, unless you rotate | restic |
| Encryption | Built in | Only in transit over SSH | restic |
| Simplicity | A repository to manage | One command | rsync |
| Restore one file | restic restore or mount | Copy it back | Tie |
| Ransomware or rm -rf | Old snapshots survive | Mirror copies the damage | restic |

## Why do you need your own VPS backups?

**Because the host keeps none, and a reinstall or a mistake wipes the disk for good.** No plan includes backups; daily backups kept 7 days can be added at checkout for 15% of the plan price. Without them, keep a copy of important data somewhere other than the server. Reboot, reinstall and delete requests are sent from the dashboard and carried out by a person; a reinstall wipes the disk. A deleted file, a broken upgrade or a lost key can all end in a reinstall.

The 3-2-1 idea still fits: three copies, two media, one off-site. For a single VPS, that means the live data plus snapshots on a server elsewhere.

## How do you set up restic over SFTP?

**Install restic, store the repository password in a root-only file, then initialise the repository on the second server.** restic uses your SSH config, so a key for backup-host must work first. Without the password, the snapshots cannot be read, so keep a copy of it off both servers.

*restic repository and nightly script*

```bash
sudo apt install -y restic
sudo sh -c 'openssl rand -base64 32 > /root/.restic-pass && chmod 600 /root/.restic-pass'
export RESTIC_REPOSITORY=sftp:backup@backup-host:/srv/restic/web1
export RESTIC_PASSWORD_FILE=/root/.restic-pass
sudo -E restic init
# nightly job (run as root):
mariadb-dump --all-databases --single-transaction > /var/backups/db.sql
restic backup /etc /home /var/www /var/backups
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
restic check
```

## Which place is best for VPS backups in 2026?

**A second server in another city, so one outage cannot take both copies.** A Hong Kong server can send its snapshots to Tokyo or Singapore. JadeKVM read WonderNetwork's public pings on 16 November 2026: Hong Kong sits 60 ms from Tokyo and 30 ms from Singapore. Latency figures on JadeKVM pages are public averages measured by WonderNetwork between its own servers on 16 November 2026; they show how far apart the cities sit on the network, not a promise about any one JadeKVM server. Both are close enough for nightly jobs.

A Bead plan with 20 GB NVMe holds compact snapshots; Pendant offers 45 GB NVMe. See [the pricing page](https://jadekvm.com/pricing/ "How much does a JadeKVM server cost per month?") for every size.

## How do you back up a VPS with rsync instead?

**rsync mirrors folders over SSH in one command; add dated folders if you need history.** It suits static sites and small setups. Use `--delete` with care, since it removes files on the target that vanished at the source.

*rsync mirror over SSH*

```bash
rsync -aHAX --numeric-ids --delete -e ssh /var/www/ backup@backup-host:/srv/mirror/web1/var-www/
rsync -aHAX --numeric-ids -e ssh /etc/ backup@backup-host:/srv/mirror/web1/etc/
```

## What should a VPS backup include?

**Configs, user data, web roots and database dumps; not the system files apt can reinstall.** Copying a live database folder gives broken files, so dump first. For WordPress, back up the dump and wp-content, as noted in [how to install WordPress on a VPS](https://jadekvm.com/guides/how-to-install-wordpress-on-a-vps/ "How do you install WordPress on a VPS?"). For containers, back up the volumes listed in [the Docker guide](https://jadekvm.com/guides/how-to-install-docker-on-a-vps/ "How do you install Docker on a VPS?").

## Questions about backing up a VPS

### Does JadeKVM back up my server?

No. Backups are not part of any plan, so keep a copy of important data on another machine.

### Which is the best backup tool for a Linux VPS?

restic for encrypted snapshots with history; rsync for a plain mirror. Borg is another strong option.

### How often should I back up a VPS?

Nightly for most sites, more often for busy shops or databases. Match the interval to the data you can afford to lose.

### Can I back up to the same server?

Only as a convenience. A disk wipe or reinstall removes both copies.

### How do I restore one file with restic?

Run restic restore latest --target /tmp/restore --include /path/to/file, then copy it back.

**Verdict**

- **Nightly restic snapshots to a server in another city**, with 7 daily copies and a tested restore.
- JadeKVM includes no backups, so set this up before you put real data on the server.

## Sources

1. [Preparing a new repository](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html) — restic (read 2026-11-16)
2. [Removing backup snapshots](https://restic.readthedocs.io/en/stable/060_forget.html) — restic (read 2026-11-16)
3. [Restoring from backup](https://restic.readthedocs.io/en/stable/050_restore.html) — restic (read 2026-11-16)
4. [rsync(1) manual page](https://download.samba.org/pub/rsync/rsync.1) — Samba / rsync (read 2026-11-16)
5. [WonderNetwork: pings from Hong Kong](https://wondernetwork.com/pings/Hong%20Kong) — WonderNetwork (read 2026-11-16)

**Add a backup server in a second city** One price in Hong Kong, Tokyo and Singapore. Bead costs $3.75 a month on 12 months. [Order Bead in Tokyo](https://jadekvm.com/app/checkout/?plan=bead&term=12m&location=jp-tyo&from=how-to-back-up-a-vps&lang=en) · [See every plan](https://jadekvm.com/pricing/ "How much does a JadeKVM server cost per month?")

---

JadeKVM: JadeKVM sells Linux KVM VPS in Hong Kong, Tokyo and Singapore, paid in crypto with no ID document, and publishes the measured latency from each city to the rest of Asia. 5 plans from 1 to 16 GB of RAM cost the same in all three cities and, on the 12-month term, sit at least 25% under a named comparable no-KYC crypto plan read on 16 November 2026. The operator is DomaineGoat LLC, Panama.
