> ## 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.

# Clone a stopped Computer

> Copy a stopped Computer's disk into a new persistent Computer, understand persistent_computers count admission, and re-authorize fresh access.

**Clone** copies a **stopped** Computer's disk into a new persistent Computer with its own ID, fresh `/etc/machine-id`, and new SSH Host Key. The child inherits the source's configured Memory (`ram_mib`) and is admitted against your current Account pool and `persistent_computers` limit.

Use Clone to branch an environment for an experiment without altering the source. Clone copies disk state only—it is **not** a live-memory or running-process fork, and it never silently Stops a running source.

## What is copied vs. fresh on the child

| Asset / Setting | Child Computer behavior |
| - | - |
| Guest files, repos, installed packages, disk configs | Copied from the stopped source disk |
| User-written credentials, browser profiles, cookies, bots/systemd jobs on disk | Copied as ordinary disk files (inspect sensitive files/services beforehand!) |
| Subsequent disk writes | Independent between source and child |
| Configured `ram_mib` | Inherited from source (admitted against active pool at Clone time) |
| Computer ID, `/etc/machine-id`, SSH Host Key | **New** |
| Platform SSH public-key authorizations, Share links, Vault grants, display name | **Not inherited**—authorize explicitly on the child |
| RAM, running processes, open TCP sessions | **Not copied** |

> [!WARNING]
>
> **Check startup services and browser profiles before cloning:** Because Clone copies the Guest disk faithfully, any self-starting bot, cron job, or saved browser/SaaS session on disk will also exist on the child when it boots, which can cause duplicate jobs or third-party session conflicts. Clean or disable them on the source before cloning if unintended.

## Clone with a saved idempotency key

Clone consumes **one slot** in your Account's `persistent_computers` limit (**50 / 500 / 1,000 / 1,000** across Starter / Pro / Max 16 / Max 32) plus Storage and running Memory for the child. In the Console, **Stop** the source Computer, then open **Settings → Advanced → Clone Computer**.

Through [`@deepest/sdk`](https://docs.deepest.dev/api-and-sdk/typescript), save a unique `DEEPEST_CLONE_KEY` before calling `clone()`, and reuse that exact key + source ID 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 sourceId = process.env.DEEPEST_COMPUTER_ID;
const source = deepest.computer(sourceId);
const before = await source.get();
const pool = await deepest.resources.get();
if (!before.ok || !pool.ok) throw new Error("Inspect source and pool first.");

if (before.result.state !== "stopped") {
  throw new Error("Save work and explicitly Stop the source Computer before Clone.");
}
if (pool.result.entitlement.status !== "active") {
  throw new Error("Active compute entitlement required.");
}
if (pool.result.ram_limit_mib - pool.result.ram_used_mib < before.result.ram_mib) {
  throw new Error("Insufficient Account running Memory for the child.");
}

const childReply = await source.clone({ idempotency_key: process.env.DEEPEST_CLONE_KEY });
if (!childReply.ok) throw new Error(`${childReply.error.code} (${childReply.retry})`);

const child = childReply.result;
console.log("Source:", sourceId, "Child:", child.id, child.state);
```

Expected outcome: the source remains `stopped`, and the child has a distinct `id`, `state: "running"`, and its own Linux environment. Verify the child via `deepest.computer(child.id).exec(...)`, and never confuse source and child IDs in follow-up actions.

## Re-authorize access on the child

Because platform credentials are never inherited:

* Add SSH public keys to `child.id` via [SSH](https://docs.deepest.dev/connect/ssh.md) and fetch its own `ssh.endpoint()` (expect a new Host Key).
* Grant only needed [Vault](https://docs.deepest.dev/security/vault.md) secrets to `child.id`.
* Create separate [Private Preview](https://docs.deepest.dev/network/private-preview.md) or [Share](https://docs.deepest.dev/network/share.md) routes for the child's ports.

## Memory, CPU, and Storage considerations

* **Memory:** Cloning a `2,048 MiB` stopped source creates a `2,048 MiB` running child. Starting both concurrently requires `4,096 MiB`. You cannot specify a different size inside `clone()`—resize the stopped source beforehand if needed (only after resolving any prior uncertain clone intent).
* **CPU & Network:** Source and child share the same Account `shared_cpus` budget and Paid network Fair Use pool.
* **Storage:** Both disks remain Account Storage; independent writes and snapshots add to `storage_used_bytes`.

## Failure and recovery

| Result | Recovery |
| - | - |
| `STOPPED_REQUIRED` | Save work and explicitly Stop the source first |
| `LIMIT_EXCEEDED` | Check `error.limit.dimension`: `memory` (free RAM), `persistent_computers` (Delete unused Computers—Stop keeps the slot), or `reserved_intents` |
| `STORAGE_LIMIT_EXCEEDED` | Clean disposable data/snapshots or increase capacity |
| `IDEMPOTENCY_CONFLICT` | Key belongs to a different request or source; recover that original intent |
| `RESOURCE_CONFLICT` | Resolve reported dependency/legacy accounting limitation rather than forcing deletion |
| `LIFECYCLE_BUSY` / `RUNTIME_UNAVAILABLE` (`retry: "safe"`) | Wait `error.retry_after_seconds` (if 429) or capacity recovery, then retry with the **same source and same `idempotency_key`** |
| `UNKNOWN` (`retry: "query-first"`) | Query any returned `resource_id` and `computers.list()`; if recovering via Clone, reuse the **identical source ID and `idempotency_key`**—never generate a new key |

When your experiment finishes, Stop the child to free Memory or explicitly Delete `child.id` after confirming the ID so you don't delete the source by mistake. See [Computer lifecycle](https://docs.deepest.dev/computers/lifecycle.md) and [Errors](https://docs.deepest.dev/api-and-sdk/errors.md).


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