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

# Create disk snapshots and restore a Computer

> Capture a stopped Computer's disk, restore a checkpoint to the same Computer ID, and understand disk-only and backup boundaries.

A Deepest **Snapshot** captures a **disk-only** checkpoint of a stopped Computer. Snapshots do **not** save RAM, running process IDs, open TCP sockets, or live browser execution, and they are **not** off-node disaster-recovery backups.

Both capture and restore require the target Computer to be explicitly **stopped**—Deepest never silently stops a running Computer. Use [Clone](https://docs.deepest.dev/computers/clone.md) when you want a separate Computer instead of rolling back the original disk.

## What a snapshot preserves vs. leaves untouched

| Item | Snapshot / Restore behavior |
| - | - |
| Guest files, packages, and disk data | Captured and rolled back on Restore |
| RAM, running processes, TCP sessions | **Not captured**; Restore cold-boots Linux |
| Computer ID, SSH Host Key, SSH keys, Vault grants, API Keys | Preserved (Restore does **not** roll back current control-plane authorization) |
| Configured Memory & Account `shared_cpus` | Restore boots with current Computer/Account config |
| Secrets/credentials manually saved inside Guest files | Captured as ordinary disk files—review what apps persist |

## Capture a snapshot

In the Console, **Stop** the Computer, open **Settings → Snapshots**, and click **Create snapshot**.

With [`@deepest/sdk`](https://docs.deepest.dev/api-and-sdk/typescript), save a unique `DEEPEST_SNAPSHOT_KEY` before calling `snapshots.create()` and keep it unchanged if recovery is needed:

```js theme={null}
import { Deepest } from "@deepest/sdk";

const deepest = new Deepest({
  baseUrl: process.env.DEEPEST_API_URL,
  apiKey: process.env.DEEPEST_API_KEY,
});
const computer = deepest.computer(process.env.DEEPEST_COMPUTER_ID);

const stopped = await computer.stop();
if (!stopped.ok || stopped.result.state !== "stopped") {
  throw new Error("Save work and explicitly Stop the Computer before snapshotting.");
}

const snap = await computer.snapshots.create({
  idempotency_key: process.env.DEEPEST_SNAPSHOT_KEY,
});
if (!snap.ok) throw new Error(`${snap.error.code} (${snap.retry})`);
console.log("Snapshot ID:", snap.result.id, "disk_only:", snap.result.disk_only);
```

Capture leaves the Computer `stopped` (Snapshot creation does not consume a `persistent_computers` count slot, though retained snapshot blocks consume Account Storage).

## Restore the same Computer

Restore overwrites disk writes made after the Snapshot and boots the **same Computer ID** into `running`. Export any newer work you want to keep before restoring. In the Console, open **Settings → Snapshots**, select **Restore**, and confirm **Overwrite and restore**.

```js theme={null}
const snapshotId = process.env.DEEPEST_SNAPSHOT_ID;
const selected = await computer.snapshots.get(snapshotId);
if (!selected.ok) throw new Error(selected.error.code);

const before = await computer.get();
if (!before.ok || before.result.state !== "stopped") {
  throw new Error("Explicitly Stop the Computer before Restore.");
}

const restored = await computer.snapshots.restore(snapshotId);
if (!restored.ok) throw new Error(`${restored.error.code} (${restored.retry})`);
if (restored.result.state !== "running") {
  throw new Error("Query the original Computer to confirm startup.");
}
```

> [!WARNING]
>
> `snapshots.restore` has `retry: "no-retry"`. Replaying a completed Restore overwrites writes made after the first restoration. After `UNKNOWN`, inspect the original Computer and its actual disk files rather than blindly repeating Restore.

Verify restored disk state directly (for example checking a project file or version via SSH or `exec`)—a `running` Computer alone does not prove which checkpoint is active.

## Delete unneeded snapshots

Deleting a snapshot removes only that recovery point, leaving the Computer intact (`snapshots.delete(snapshotId)`). Account Storage decreases only when no other retained disk or snapshot shares those blocks—verify with `resources.get()`. Deleting the **Computer** removes its attached snapshots automatically.

## Failure and recovery

| Symptom | Recovery |
| - | - |
| `STOPPED_REQUIRED` | Save application work, explicitly Stop the Computer, and confirm `stopped` |
| `STORAGE_LIMIT_EXCEEDED` | Inspect Account Storage and remove unneeded files/snapshots before capturing |
| `LIMIT_EXCEEDED` (`memory`) during Restore | Restore boots the Computer; ensure available running Memory fits |
| `RESOURCE_CONFLICT` | Resolve reported dependency or legacy asset restriction |
| `LIFECYCLE_BUSY` (`retry: "safe"`) | Wait `error.retry_after_seconds` and retry explicitly with the original key (for Create) |
| Capture `UNKNOWN` | Call `snapshots.list()` / `snapshots.get()`; reuse exact `idempotency_key` only if needed |
| Restore `UNKNOWN` | Query the Computer and inspect actual disk files; never replay blindly |
| Delete `UNKNOWN` | Query `snapshots.get(snapshotId)`; `NOT_FOUND` confirms absence |

Keep an external copy (Git push, SFTP export, or external storage) for critical work—on-platform snapshots do not replace off-node backup. See [Clone](https://docs.deepest.dev/computers/clone.md) and [Storage Reclaim](https://docs.deepest.dev/computers/storage-reclaim.md).


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