Snapshots

View as Markdown

A snapshot is a saved state of a Sandbox at a point in time - the filesystem with everything installed and configured in it.

Snapshots do the job of custom container images on other platforms. Instead of writing a Dockerfile, building it, and pushing it to a registry, you prepare a Sandbox once, save it, and start new machines from that state.

Using a snapshot as a base image

A common pattern:

  1. Create a Sandbox and set it up completely - system packages, language runtimes, tooling, cloned repositories, warmed dependency caches.
  2. Save a snapshot and give it a meaningful name, for example node-app-base.
  3. Create every new Sandbox from that snapshot.

New machines skip installation entirely and are ready the moment they boot.

In the UI

Creating a snapshot

Open the three-dot menu on a Sandbox row, or work from inside the Sandbox, and choose Create snapshot. Name it and confirm.

Image loading...Create snapshot from the Sandbox context menu

Starting a Sandbox from a snapshot

When creating a Sandbox, open Clean OS or snapshot and pick a snapshot instead of an operating system. One snapshot can back any number of Sandboxes.

Image loading...The Clean OS or snapshot selector with a snapshot chosen as the base

The snapshot list

Every snapshot in the project is in one place. Open the menu next to New sandbox on the Sandboxes view and choose Snapshots.

Image loading...The Snapshots entry in the Sandboxes view menu

Each row shows the Sandbox the snapshot came from, its size, and when it was taken. A single Sandbox's own snapshots are also listed in its Settings, in the Snapshot section.

Image loading...The Snapshots view with the context menu of a snapshot open

The three-dot menu on a row is where everything happens:

  • Run in new sandbox… - creates another Sandbox from the snapshot, leaving the current machine untouched
  • Restore - replaces the current disk state of the source Sandbox with the snapshot
  • Delete

Reverting to a snapshot

Restore is the revert. It rolls the Sandbox back to the state the snapshot was taken in, on the same machine, so the identifier, the endpoints, and the variables all stay as they are.

Warning
Restoring replaces the current state of the Sandbox with the older one, which requires confirmation. Everything written after the snapshot was taken is gone. To keep the current state as well, snapshot it before you restore.

Automatic snapshots

The Snapshot section in the Sandbox Settings includes two controls: Auto-snapshot and Retention (see Retention).

Image loading...Auto-snapshot options in the Snapshot section of the Sandbox settings

Auto-snapshot takes a snapshot Every hour, Daily, or Weekly. The default is Off. Buddy takes scheduled snapshots only while the Sandbox is running and skips it when it is stopped.

You can also set both when you create a Sandbox:

Image loading...Auto-snapshot and Snapshot retention in the new Sandbox form

In YAML, the same settings are backup and snapshot_retention:

yaml
backup: DAILY
snapshot_retention:
  keep_last: 10

backup accepts OFF, HOURLY, DAILY, or WEEKLY. To retain snapshots by age, use keep_for_days instead of keep_last.

From the CLI

Save the current state. --wait holds until the snapshot is ready:

bash
bdy sb snapshot create my-sandbox -n node-app-base --wait
$

List them. With a Sandbox identifier you get that machine's snapshots, without one every snapshot in the project:

bash
bdy sb snapshot list my-sandbox
bdy sb snapshot list
$$

Inspect one. Both arguments are required - the Sandbox first, then the snapshot:

bash
bdy sb snapshot get <sandbox> <snapshot>
$

Start a new Sandbox from it. --snapshot replaces the operating system as the base:

bash
bdy sb create -i my-sandbox-2 --snapshot node-app-base
$

Remove one. Deleting asks for confirmation, so add -f when the command runs unattended, in a pipeline or a cleanup script:

bash
bdy sb snapshot delete <sandbox> <snapshot>
$

Retention

By default, a snapshot stays until you delete it. Snapshots are not deleted together with the Sandbox they came from, so you can throw away the Sandbox and keep the prepared state.

A retention policy deletes old snapshots automatically. It has two modes:

  • Versions - keep the specified number of most recent snapshots (keep_last in YAML)
  • Days - keep snapshots created within the specified number of days (keep_for_days in YAML)

In the Snapshot section of the Sandbox Settings, click Retention, switch between Versions and Days, then pick 1, 3, 14, or 30, or type a number. In the new Sandbox form, the same options are Keep the most recent and Keep versions from the last.

Image loading...Retention options with the Versions mode selected

Warning
Retention applies to all snapshots of the Sandbox, including manually created snapshots. With Last 3 versions and a daily auto-snapshot, a base snapshot such as node-app-base is deleted after three newer snapshots are created. Create base snapshots from a Sandbox without a retention policy.

If a pipeline snapshots a Sandbox on every run, set retention on that Sandbox instead of adding a cleanup step.

Snapshot or copy?

Both give you a machine with the same disk contents, but they answer different questions:

Use it when
Snapshot You want a reusable base to create many Sandboxes from, now and later
Copy of a Sandbox You want one duplicate of a machine as it is right now

Automating snapshots

Snapshots do not have to be taken by hand.

  • On a schedule - turn on Auto-snapshot in the Sandbox settings or set backup in YAML.
  • From a pipeline - the Manage Sandbox action has a Create snapshot operation, so a pipeline can checkpoint an environment after a successful build.
  • From inside the Sandbox - this snapshot create -n before-migration lets a script or an AI agent save a known-good state before a risky change. See Self-management.
Info
Snapshots can also be managed programmatically - over the REST API, from the SDK, and through MCP by AI agents. The schedule and the retention are the backup and snapshot_retention fields of the create and edit Sandbox endpoints.

Last modified on Nov 17, 2026