---
title: "How to Back Up Your VPS Data Off the Server · CloudSat docs"
description: "Why snapshots are not backups, and how to set up encrypted nightly backups of a CloudSat server to another machine with restic, then test a restore."
url: https://cloudsat.io/docs/backup-your-data
updated: 2026-11-18T12:00:00Z
source: CloudSat (https://cloudsat.io/). Prices in USD.
---

# Back up your data off the server

Why snapshots are not backups, and how to set up encrypted nightly backups of a CloudSat server to another machine with restic, then test a restore.

CloudSat team Updated Nov 18, 2026 3 min read

Snapshots are a quick way to undo a change, but they are not backups. A snapshot lives with its server: it is deleted with the server, it can only be restored onto that server, and the [service level agreement](https://cloudsat.io/legal/sla) does not cover data loss. Keep at least one copy of the data that matters on another machine, ideally in another region.

## Why a snapshot is not enough

- Deleting a server removes its snapshots at the same time.
- A server that stays suspended past the 7-day grace period is deleted with its snapshots.
- You cannot open a snapshot to pick out one file, or restore it onto a different server.
- CloudSat does not back up your servers for you: what you keep is up to you.

## Choose where backups go

- A second CloudSat server in another region. A storage-oriented plan starts at $2.78 a month; see [storage VPS hosting](https://cloudsat.io/storage-vps-hosting).
- Object storage from a provider you choose.
- A machine of your own, such as a NAS at home or in the office.

A good rule is three copies of your data, on two kinds of storage, with one copy off-site.

## Set up nightly backups with restic

restic is an open-source backup tool: it encrypts, deduplicates and only sends what changed. These steps back up an Ubuntu or Debian server to another server over SFTP. Replace the addresses and paths with yours.

1. On the backup server, create a user and a directory for the backups, for example the user `backup` and `/srv/restic`, owned by that user.
2. On the server you back up, install restic and create an SSH key for root if it has none:

```bash
apt-get install -y restic
ssh-keygen -t ed25519
```

1. Add the content of `/root/.ssh/id_ed25519.pub` to `/home/backup/.ssh/authorized_keys` on the backup server. Then connect once with `ssh backup@198.51.100.20 exit` to accept the backup server's host key.
2. Create a repository password and save a copy in your password manager. Without it, nobody can read the backups, including you:

```bash
openssl rand -base64 32 > /root/.restic-pass
chmod 600 /root/.restic-pass
```

1. Write the settings to `/root/.restic.env`:

```bash
export RESTIC_REPOSITORY="sftp:backup@198.51.100.20:/srv/restic/web-01"
export RESTIC_PASSWORD_FILE="/root/.restic-pass"
```

1. Create the repository and run the first backup:

```bash
. /root/.restic.env
restic init
restic backup /etc /var/www /root
```

1. Schedule a nightly run with a file `/etc/cron.d/restic-backup`. It backs up at 02:30, then keeps 7 daily, 4 weekly and 6 monthly copies:

```text
30 2 * * * root . /root/.restic.env && restic backup --quiet /etc /var/www /root /var/backups && restic forget --quiet --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
```

restic calls each backup a "snapshot" too. Those live in your repository, not in the CloudSat console.

## Back up databases as dumps

Copying the files of a running database can produce a broken copy. Dump it first, into a folder that restic backs up, for example in the same cron line before `restic backup`:

```bash
mysqldump --single-transaction --all-databases > /var/backups/mysql.sql
sudo -u postgres pg_dumpall > /var/backups/postgres.sql
```

## Test a restore

A backup you have never restored is a guess. Once a month, restore the latest copy into a scratch folder and look at it:

```bash
. /root/.restic.env
restic snapshots
restic restore latest --target /tmp/restore-test
restic check
```

`restic check` verifies the repository structure. Compare a few files, and import a database dump into a test database now and then.

## Tips

- Put the backup server in another region than the servers it protects.
- Attach a cloud firewall to the backup server that allows SSH only from the addresses of your servers. See [Create and apply cloud firewalls](https://cloudsat.io/docs/cloud-firewalls).
- Only outbound traffic counts toward a transfer allowance: a backup uses the allowance of the server that sends it, and a restore that of the backup server. See [Transfer allowance and overage](https://cloudsat.io/docs/transfer-allowance).
- On Windows servers, restic also runs on Windows, or use Windows Server Backup with a destination on another machine.
- Keep snapshots for quick rollbacks before risky changes: [Take a snapshot](https://cloudsat.io/docs/take-a-snapshot).

- [Snapshot pricing and limits](https://cloudsat.io/docs/snapshot-pricing-and-limits): Previous Snapshot pricing and limits
