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

# Snapshots

> Save a machine as a named image, then boot fresh machines from it whenever you want.

A snapshot is a saved copy of a machine that you keep. It captures the disk and the memory, so a machine booted from it comes up already running whatever the original was running.

The difference from a [fork](/guides/fork) is what you end up with. A fork gives you a second machine right now. It copies a machine that is still there, and afterwards both the original and the copy carry on running side by side. A snapshot gives you an image for later.

Reach for a snapshot when startup time is what matters. A machine created from one wakes into the captured state instead of booting and then starting your app, so this is the fastest way to stand up many identical machines. [Preview environments](/use-cases/preview-environments) are the clearest case, where every pull request needs the same app, ready straight away.

<Frame caption="A running machine saved as a named image in seconds.">
  <video autoPlay muted loop playsInline src="https://mintcdn.com/azin/psRZbQh2QwMUVL3U/videos/snapshots-2.mp4?fit=max&auto=format&n=psRZbQh2QwMUVL3U&q=85&s=21d23ff34c2df24fdde4a901647a877f" data-path="videos/snapshots-2.mp4" />
</Frame>

## Save a snapshot

```bash theme={"theme":"github-dark"}
boxd snapshots save myapp my-workspace
```

```
Snapshotting myapp → my-workspace (v1)…
Saved my-workspace v1 (5.8G)
```

The machine has to be `running` when you save. The capture pauses it just long enough to grab the memory and disk together, then lets it carry on, so the machine keeps running the whole time.

`snap` is the short alias, so `boxd snap save myapp my-workspace` does the same thing.

## Create machines from it

```bash theme={"theme":"github-dark"}
boxd machine new fresh --from-snapshot my-workspace
```

```json theme={"theme":"github-dark"}
{
  "name": "fresh",
  "id": "10739662-5f17-4ace-b1ff-c777b3e84b11",
  "url": "fresh.boxd.sh",
  "source": "snapshot/my-workspace",
  "boot": "17ms"
}
```

Each machine gets its own name, URL, and SSH port, and comes up exactly where the snapshot was taken. Make as many as you want from the same snapshot.

## Everything running comes back

A machine created from a snapshot wakes straight into the state you captured. A web server that was listening on the original is already listening on the new machine, under the same PID, with the same process start time, and the machine's uptime continues from the original rather than resetting.

Everything the original had already done stays done: dependencies installed, the database warm, the dev server compiled. That is why creating machines from a snapshot stays fast even when you make a lot of them at once.

Each new machine does get its own identity when it wakes. The hostname and private IP are fresh while the processes keep going, so a long-lived process that cached the original's hostname or address holds a stale value on the new machine.

## List and remove

```bash theme={"theme":"github-dark"}
boxd snapshots list
boxd snapshots remove my-workspace -y
```

```
NAME          VERSION  STATUS  SIZE  USED
my-workspace  v2       ready   6.1G  1
```

`USED` is how many machines currently came from it. `STATUS` is `ready` once the snapshot can be restored from, which takes a moment after saving.

## Saving again makes a new version

Saving over a name you already used captures a new version, and `--from-snapshot` always restores the latest one. New machines keep coming from the previous version until the fresh capture is ready, and once it is, the older version is cleaned up.

```bash theme={"theme":"github-dark"}
boxd snapshots save myapp my-workspace   # v1
# ...more setup inside myapp...
boxd snapshots save myapp my-workspace   # v2, and v2 is what new machines get
```

So one name can be your moving known-good marker. Keep saving over it as the machine evolves, and every new machine starts from the freshest capture.

## From inside a machine

Machines can snapshot themselves. Leave the machine name out and it uses the one you are in:

```bash theme={"theme":"github-dark"}
boxd snap save nightly-state
```

## Who can see them

A snapshot belongs to the organization that contains the source machine and never crosses into another org. Who can see it follows the source machine. A snapshot of a shared org machine is visible to the whole org. A snapshot of a private machine is visible only to whoever captured it.

A machine created from a snapshot is private to whoever created it, billed to the snapshot's org. So a teammate can take a shared snapshot and stand up their own private copy to work in, leaving the shared original alone. That is the same pattern as [forking a shared machine](/guides/share-a-vm).

<Warning>
  A restore rebuilds the machine from the captured state, so it cannot take extra disks at the same time. `boxd machine new --from-snapshot ... --volume ...` is refused. Create the machine first, then attach the disk.
</Warning>

## Compared to suspend and hibernate

Suspend and hibernate also capture memory, but boxd manages those for you to freeze and wake one machine, and they are temporary. A snapshot is a named image you create and delete yourself, and it outlives the machine. See [Suspend, resume, and hibernate](/guides/suspend-resume).
