
# VPS Snapshot Guide: Create, Restore and Roll Back

**A VPS snapshot is a point-in-time copy of your server's entire disk: the OS, packages, settings and data.** You take one before a risky change (a system upgrade, a database migration, letting an AI agent loose on the box) so that if something breaks you roll back in one step instead of repairing by hand. On 0x.cloud a snapshot costs $0.99/month.


## Snapshot vs Backup

| | Snapshot | Backups |
|---|---|---|
| Who creates it | you, on demand | automatic, every day |
| How many | the snapshots you take yourself | last 7 daily copies |
| Use it for | rolling back one specific risky change | surprises: a deleted file, a database broken last week |
| Price on 0x.cloud | $0.99/month | +20% of the plan price |

Provider snapshots and backups live on the provider's infrastructure. For data you cannot lose, also keep an off-server copy; see [VPS backups](https://0x.cloud/kb/servers/vps-backup).

## When to Take a VPS Snapshot

- **Before system upgrades,** especially release upgrades such as 22.04 to 24.04. Steps in [how to update Ubuntu Server](https://0x.cloud/kb/servers/update-ubuntu-server).
- **Before installing a panel or stack** that rewrites lots of system files.
- **Before a database migration** or a big app release.
- **Before giving an AI agent free rein.** Claude Code and Codex move fast; a snapshot lets you undo the whole session.
- **As a "golden image"** after you finish configuring a server by hand.

## How to Snapshot a VPS

### Step 1. Prepare the Server

A snapshot is taken from a live disk, so files being written at that moment may be captured half-done. To keep your database consistent:

```bash
# option 1: dump the database before the snapshot (PostgreSQL)
sudo -u postgres pg_dump mydb > /root/mydb-before.sql

# option 2: stop the app and database during the snapshot
sudo systemctl stop myapp postgresql

# flush filesystem buffers to disk
sync
```

For a stateless server (a bot without a database, a static site), `sync` is enough. The [PostgreSQL docs](https://www.postgresql.org/docs/current/app-pgdump.html) cover pg_dump options in detail.

You can hand the whole routine to an AI agent: the 0x.cloud MCP server can create snapshots and restore them, and the agent does the prep on the server.


```text
Connect to my 0x.cloud server [name] with the MCP run_command tool and prepare it for a snapshot. Dump every PostgreSQL database to /root/dumps with the date in the file name, check the files are not empty, then stop myapp and postgresql and run sync. Create a snapshot of this server through the 0x.cloud MCP named before-upgrade plus the date, wait until it is ready, then start the services again and check systemctl --failed. Only restore a snapshot after I confirm.
```


### Step 2. Create the VPS Snapshot in the Dashboard

1. Open the server page.
2. Go to the snapshots section.
3. Create a snapshot with a clear name, for example `before-upgrade-2026-11-20`.
4. Wait until it shows as ready in the list.
5. Start any services you stopped: `sudo systemctl start postgresql myapp`.

### Step 3. Make Your Change

Upgrade, install, experiment. Then check that everything works: the site loads, the bot replies, and `systemctl --failed` is empty.

## How to Restore a VPS Snapshot

1. If the server holds new data you need (orders, messages, uploads), copy it off first:
   ```bash
   # from the server to a host you control
   scp /root/new-data.tar.gz user@backup.example.com:
   ```
2. On the server page, open the snapshots section.
3. Pick the snapshot and start the restore.
4. Confirm. The current disk contents will be replaced by the snapshot.
5. Wait until the server is running again, then open the web console.
6. Test your app and bring back any data you saved in step 1.

The SSH host key reverts to the one from snapshot time, so you usually will not see a `REMOTE HOST IDENTIFICATION HAS CHANGED` warning.

## Snapshots and Server Migration

A snapshot is tied to the provider's infrastructure. To move to a different plan or another provider, migrate the data itself (rsync, database dumps) rather than the snapshot. Step by step in how to migrate a VPS.

## Common Problems and Fixes

**The database will not start or reports corruption after a restore.** The snapshot was taken mid-write. Restore the database from the dump you made beforehand, and stop the database before the next snapshot.

**Recent data is gone after a restore.** That is expected: a snapshot returns everything to the moment it was taken. Save new data before restoring, or rely on daily backups.

**Old snapshots pile up.** A snapshot costs $0.99/month, so delete one once the change is verified and you no longer need the rollback.

**Using a snapshot instead of backups.** One snapshot will not save you from a problem you notice a week later. That is what daily backups (7 copies) and an off-server copy are for.

Snapshot, backup and plan prices are on the [pricing page](https://0x.cloud/pricing).


[Create server: s1-2, $7.99/mo](https://0x.cloud/cabinet/create?plan=s1-2)


## FAQ

**What does VPS snapshot mean?**
A snapshot is a point-in-time copy of your server's disk. If a change breaks something, you can return the server to exactly how it was when the snapshot was taken.

**What is the difference between a snapshot and a backup?**
You take a snapshot by hand before a risky change so you can roll back fast. Backups run automatically every day and protect you from problems you did not see coming.

**How much does a snapshot cost on 0x.cloud?**
$0.99 per month. Automatic backups (7 daily copies) are a separate add-on at +20% of the plan price.

**Does restoring a snapshot delete newer data?**
Yes. Anything created after the snapshot is replaced by the snapshot's contents. Copy new files off the server before you restore.

**Should I shut down the server before taking a snapshot?**
Not necessarily, but stop your database or dump it first so the data inside the snapshot is consistent.
