Automatic persistence now in beta on Vercel Sandbox
Vercel Sandboxes can now automatically save their filesystem state when stopped and restore it when resumed. This removes the need for manual snapshots, making it easier to run long-running, durable sandboxes that continue where you left off.
How it works
A sandbox is the durable identity, now identified by a name, its filesystem state, and configuration options. A session is the compute tied to that state, invoked as needed.
Automatic persistence introduces orchestration that separates storage from compute, reducing the need for manual snapshotting, so:
- when you stop a sandbox, the session shuts down but the filesystem is automatically snapshotted.
- when you resume, a new session boots from that snapshot. This state storage is not charged, so you pay when your setting is active.
Persistence is enabled by default in the beta SDK, can be disabled between sessions with persistent: false. When disabled, the sandbox still exists after being stopped and can be resumed by its name, but each session starts with a clean filesystem.
If a sandbox is stopped and you run a command, the SDK will transparently create a new session, so you don't need to check state or manually restart
The beta SDK adds methods for managing sandboxes over their lifetime:
The beta CLI adds configuration management and session inspection:
This feature is in beta and requires upgrading to the beta SDK and CLI packages.
Install the beta packages to try persistent sandboxes today: pnpm install @vercel/sandbox@beta for the SDK, andpnpm install -g sandbox@beta for the CLI.
Persistent sandboxes are available in beta on all plans.
Learn more in the documentation.