This feature is currently in private preview and is not recommended for production use.
Create a snapshot
Capture a snapshot from the sandbox you want to checkpoint. Snapshot names are unique within a sandbox, and creating a snapshot with a name the sandbox already uses fails with a409 error. Every snapshot also gets an id, unique across your workspace, which the operations that do not go through the sandbox take instead of the name.
source:
POST /sandboxes/{name}/snapshots generates the snapshot name for you, so it cannot collide with an existing one. Use POST /snapshots with a source to choose the name. Sandbox-side operations take the snapshot name, workspace-side operations take snapshot.id.List snapshots
List from a sandbox to get only the snapshots captured from it:q parameter. Refer to the API reference documentation for how to page through the results.
Restore a sandbox to a snapshot
Restoring rolls a sandbox back to one of its own snapshots, in place. The sandbox keeps its name, its URLs, its previews, and its configuration: only the instance behind it is torn down and rebuilt from the snapshot, on the same machine the snapshot was taken on.ready. To roll back onto a different sandbox, fork from the snapshot instead.
You can also restore from the Blaxel console: open your sandbox, go to the Snapshots tab, and use the Restore action on the snapshot you want to go back to.
Fork a sandbox
Forking creates a new sandbox from an existing one, forking its entire memory state (files + running processes). The fork inherits the source sandbox’s image, memory configuration, environment variables, and port settings. Callingfork() automatically snapshots the source sandbox’s current state and forks from it. You don’t need to create a snapshot first.
Fork from a snapshot
To create a sandbox from a snapshot you took earlier, pass its name assnapshotId. The fork is created from that snapshot instead of the source sandbox’s current state:
id, even after its source sandbox is deleted:
targetType to application to start an application from the snapshot instead of a sandbox.
When the source sandbox still exists, the fork also inherits what the snapshot does not carry, such as environment variables, lifecycle policies, and network configuration. When the source sandbox is gone, the fork runs with the configuration stored on the snapshot.
Fork with new environment variables
Passenvs to give the fork a different environment from its source. Each variable the source already carries takes the value you pass, each variable it does not carry is added, and every other variable of the source is inherited. The source sandbox is left untouched.
envs only sets and adds variables. A variable of the source cannot be removed through a fork.envs works the same way when forking from a snapshot.
Fork with an expiration policy
A fork expires like its source: it inherits the source’slifecycle expiration policies, along with its ttl and expires. Pass lifecycle to give the fork its own expiration policies instead. The fork is then held to those policies alone, without the source’s ttl or expires. See Sandbox expiration for the available policies.
lifecycle works the same way when forking from a snapshot.
Fork request parameters
Delete a snapshot
Delete a snapshot by its name from the sandbox it was captured from:id, which also works once the sandbox is deleted:
Snapshots and sandbox deletion
Deleting a sandbox does not delete its snapshots. They keep their names and stay forkable, withsource.deleted set to true to tell you their sandbox is gone.
Archive a sandbox
Keep a sandbox’s filesystem while shutting it down, and get it back later.
Sandbox overview
Learn more about sandbox lifecycle and configuration.