> ## Documentation Index
> Fetch the complete documentation index at: https://io.net/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# VM Backup

> Nightly encrypted backups for VM on Demand. Turn it on when you deploy, see what it costs, and restore your files.

**VM Backup** saves a copy of your VM's files every night. Backups are encrypted on your VM before they are stored. Away from the VM, only your SSH private key can unlock them. On the running VM, anyone with root access can open them, so give root access only to people you trust.

VM Backup is available on selected pay-as-you-go VMs paid with IO Credits. If you don't see the **VM Backup** section when you deploy, backup isn't offered for the VM you selected.

## At a glance

* **Nightly backups.** Only the latest backup is kept.
* **Encrypted with your SSH key.** Keep your private key safe; without it, the backup can't be opened.
* **Turned on at deploy.** You can't add backup to a running VM.
* **Pay for what you store.** Storage is charged daily from your IO Credits balance.
* **Deleted when you terminate the VM.** Restore anything you need first.

## Turn on VM Backup

> [!NOTE]
>
> You can only turn on backup when you deploy a VM. You can't add it to a running VM, or turn it off while the VM runs.

1. In **Configure & Deploy**, under **SSH Keys**, select an **ed25519** key or an **RSA** key of 2048 bits or larger. Your backup is locked with these keys.
2. In the **VM Backup** section, select **Enable nightly backup**.
3. Review the backup price on the payment confirmation and click **Pay & Deploy**.
4. Check the **VM Backup** panel on the VM's details page.

**Enable nightly backup** becomes available once you select an ed25519 or RSA key. Other key types can still be used to connect to the VM.

> [!WARNING]
>
> Keep your SSH private key safe. If you lose every key the backup was locked with, the backup can't be opened by you or by io.net.

## What is backed up

Every night, VM Backup saves the files in `/home/ionet`.

Installed software, system settings and files in other locations aren't backed up. A restore gives you your files, not a copy of the whole VM.

Folders that can be rebuilt are skipped: `.cache`, `__pycache__`, `.venv`, `venv`, `node_modules`, `.next`, `build`, `dist`, `target`, `.gradle`, `.cargo` and `.terraform`, as well as `.pyc` files. Don't keep data you need in folders with these names.

### When backups run

Backups start at a random time between 03:00 and 04:00 UTC, whatever your VM's time zone. Each new backup replaces the previous one, so you can restore last night's copy, but not older ones.

> [!TIP]
>
> Files are copied while your applications run. To get a consistent copy of a database, stop it during the backup window, or export it to a file first.

## Pricing

VM Backup is charged per GB-month for the size of your stored backup, on top of the VM's compute cost.

* Billing starts with the first backup.
* Storage is charged once a day, just after 00:00 UTC, from your IO Credits balance. Each charge is for the backup you have stored at that time. For example, a backup made between 03:00 and 04:00 UTC on Monday is charged just after 00:00 UTC on Tuesday.
* The minimum charge is \$0.01 per day while a backup is stored.

All times on this page are in UTC.

The VM's details page shows your stored size, your last charge and an estimated daily cost.

### Estimate your cost

For the size, use the size of your files in `/home/ionet`. Your stored backup is usually smaller.

Backup size (GB)

Days stored

## Keep your balance funded

Backups need your IO Credits balance to cover the day's backup charge plus 24 hours of your VM's compute.

* **Before each backup:** if your balance is too low, that night's backup is skipped and you are notified. Your previous backup is kept. This check estimates your backup size on the high side, so keep some room in your balance.
* **At the daily charge:** if your balance is too low, backups are paused. If you have a stored backup, you are notified to top up before **22:30 UTC** that day. If you don't, the stored backup is deleted that night.

Backups resume automatically after you top up. If the stored backup was deleted, they start again with a new backup.

> [!WARNING]
>
> A backup deleted because of an unpaid charge can't be recovered.

## Leave the backup service running

io.net installs and manages a backup service on your VM. You don't need to start or schedule anything.

* Don't stop, change or remove the backup service, and keep outbound internet access (HTTPS) open.
* Don't copy or share the files in `/etc/io-vm-backup`. Anyone who has them can access this VM's backup.

Changing VM Backup's settings on the VM, such as keeping more backups, isn't supported. You are charged for everything stored, and support restores only the latest backup.

Stopping the service doesn't turn off VM Backup or stop billing: new backups stop, but the last stored backup is still charged. If **Last backup** on the VM's details page is more than two days old, contact [io.net support](https://support.io.net/en/support/home).

## Backup status

The **VM Backup** panel on the VM's details page shows the status, the time of the last backup, the stored size and the charges.

| Status | Meaning |
| - | - |
| **Setting up** | Backup is being set up on the new VM. |
| **Active** | Nightly backups are running. |
| **Not enabled** | Backup couldn't be set up. Redeploy the VM with backup enabled if you need it. |
| **Paused (not enough credits)** | Your balance didn't cover the daily charge. Top up to resume. If a time is shown, top up before it, or the stored backup is deleted. |
| **Deleting (not enough credits)** | The top-up deadline passed, and the stored backup is being deleted. |
| **Kept after the VM ended** | The VM has ended, and its backup is kept until the date shown. |
| **Deleting** / **Deleted** | The backup is being deleted, or has been deleted. |

## When the VM ends

* **You terminate the VM:** the backup is deleted at once and can't be restored. Restore anything you need **before** you terminate.
* **The VM expires, is lost because of a provider problem, or ends because your balance ran out:** the backup is kept for 7 days and billed daily, then deleted. Contact [io.net support](https://support.io.net/en/support/home) to restore it during that time. If your balance doesn't cover a day's charge, you are notified to top up before 22:30 UTC, or the backup is deleted that night.

You are notified when a kept backup is deleted at the end of its 7 days.

## When a backup can be lost

* You terminate the VM.
* Your balance doesn't cover the daily charge by 22:30 UTC.
* 7 days pass after the VM ends, or you ask support to delete the backup sooner.
* You lose every SSH private key the backup was locked with.
* The backup service is stopped or removed, or the VM can't reach the internet. Only the last backup made before that can be restored.

Also keep in mind:

* Changes made after the last backup aren't in it.
* Only the latest backup is kept. If a file is deleted or damaged and a backup runs before you restore it, the earlier version is gone.
* Until the first backup completes, there is nothing to restore.
* Files outside the backed-up folders, and files in skipped folders, are never backed up.

## Restore your data

You can restore your files in two ways:

* **With a restore bundle from io.net support.** Use this when the VM has ended, or to restore your files to another machine.
* **On the running VM.** Use this to get back last night's copy of a file.

### Restore with a bundle from io.net support

You need:

* The SSH private key that matches a key you selected when you deployed the VM.
* A computer or VM running Ubuntu 22.04 or 24.04 (x86-64 or ARM64), with internet access and enough free disk space for your files.

> [!WARNING]
>
> Planning to terminate the VM? Restore your files first. Terminating the VM deletes its backup at once.

**1. Request a restore bundle from io.net support**

Contact [io.net support](https://support.io.net/en/support/home) from the email address of your io.net account, and include your **VM ID**, shown on the VM's details page.

Support sends you a restore bundle, a file named `bundle.json`. It works for 12 hours, so request it when you're ready to restore. The bundle can't open your backup on its own: only your private key can.

Save the bundle in your home directory on the machine you are restoring to.

**2. Install the restore tool**

Skip this step if you are restoring on a VM that was deployed with VM Backup turned on, because the tool is already installed there.

```bash theme={null}
sudo apt-get update && sudo apt-get install -y curl ca-certificates
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x01B12027C61044EAC62A7C046252114E900A2921" | sudo tee /etc/apt/keyrings/ionet.asc > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/ionet.asc] https://packages-io-net.s3.amazonaws.com/ubuntu stable main" | sudo tee /etc/apt/sources.list.d/ionet.list > /dev/null
sudo apt-get update && sudo apt-get install -y io-vm-backup
```

**3. Restore your files**

Run this command, replacing `~/.ssh/id_ed25519` with the path to your private key:

```bash theme={null}
sudo io-vm-backup restore latest --target ~/restored --bundle ~/bundle.json --identity ~/.ssh/id_ed25519
```

Your files are restored under `~/restored` with their original paths. For example, `/home/ionet/project/model.pt` is restored to `~/restored/home/ionet/project/model.pt`. Some files are owned by root, so use `sudo` to copy them.

If the restore stops, or the bundle expires before it finishes, run the same command again. Ask support for a new bundle first if the old one has expired. The restore continues where it stopped.

If the VM is still running, don't restore while its nightly backup runs. Backups start between 03:00 and 04:00 UTC. If a nightly backup ran since your first attempt, restore into a new, empty folder instead.

**4. Delete the bundle**

When the restore is done, delete the bundle:

```bash theme={null}
rm ~/bundle.json
```

To move your files to a new VM, copy them from `~/restored` with a tool such as `rsync` or `scp`. Don't copy the restored `.ssh` folder over the new VM's own, or you replace the SSH keys you deployed it with.

> [accordion] The restore says the bundle has expired
>
> A bundle works for 12 hours. Ask support for a new one, save it as `~/bundle.json`, and run the same command again.

> [accordion] The restore says the backup can't be opened with your key
>
> The key isn't one the backup was locked with. Try another ed25519 or RSA key that you selected when you deployed the VM.

### Restore on the running VM

While the VM is running, you can restore last night's backup on the VM itself:

```bash theme={null}
sudo io-vm-backup restore latest --target /io-vm-backup-restore
```

Your files are restored under `/io-vm-backup-restore` with their original paths. The folder is created if it doesn't exist. Copy back the files you need.

> [!WARNING]
>
> Always restore into an empty folder outside `/home/ionet`, such as `/io-vm-backup-restore`. Restoring over your working folders replaces today's files with last night's copy. A restored copy inside `/home/ionet` would also be backed up, and charged, again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.