Skip to main content
When you pause a sandbox or create a snapshot from it, E2B saves a snapshot you can resume or create new sandboxes from later. By default that snapshot includes both the filesystem and the memory, so resuming restores the sandbox exactly as it was — running processes and in-memory state included. A filesystem-only snapshot persists only the filesystem. There is no memory snapshot, so resuming it, or creating a sandbox from it, reboots the sandbox from its disk: the files on disk survive, but RAM and running processes do not. You choose what a snapshot persists with the mode option, which is 'full' (the default) or 'filesystem'. The same option exists on pause(), on the timeout auto-pause, and on createSnapshot() / create_snapshot(). The type is exported as SnapshotMode in both SDKs.
mode is available from JavaScript SDK e2b 2.55.0 and Python SDK e2b 2.55.0. Earlier SDKs expose the filesystem-only pause through keepMemory: false (JavaScript) / keep_memory=False (Python), which keep working but are deprecated in favor of mode: 'filesystem' / mode="filesystem". Passing both to the same call is rejected client-side.

Full vs. filesystem-only

Network connections to clients outside the sandbox drop when it pauses — in both cases — and must be re-established on resume (see Persistence). The in-sandbox difference: a full snapshot keeps the process running so it can serve again immediately, while a filesystem-only snapshot reboots, so the service must be restarted first.
Use a filesystem-only snapshot when you only care about the data on disk and don’t need running processes restored — for example, persisting a workspace’s files between sessions, checkpointing build or scratch state, or producing a template that many sandboxes start from. The snapshot is smaller and faster to take because there’s no memory image, at the cost of a boot when it is used.

Create a filesystem-only snapshot

Pass mode: 'filesystem' (JavaScript) / mode="filesystem" (Python) to createSnapshot() / create_snapshot(). The source sandbox is paused while the filesystem is captured and then keeps running either way; the resulting snapshot has no memory image, so every sandbox created from it reboots from disk.
Omitting mode (or passing 'full') takes a full memory snapshot, as before. Everything else about snapshots — naming, listing, deleting, creating sandboxes from them — works the same way; see Snapshots.

When the request is refused

If filesystem-only snapshots are not enabled for your project yet, the request is refused before the sandbox is touched. The sandbox keeps running and no snapshot is created. In JavaScript this is a SandboxError with statusCode 400; in Python a SandboxException with status_code 400. A full memory snapshot is never affected.

Pause filesystem-only

Pass mode: 'filesystem' (JavaScript) / mode="filesystem" (Python) to pause(). The filesystem is saved; memory is dropped.
mode defaults to 'full', so omitting it (or calling pause()) takes a full memory snapshot — see Persistence. mode is a per-pause choice, not a sandbox-wide setting. Pausing once with mode: 'filesystem' (JavaScript) / mode="filesystem" (Python) does not lock the sandbox into filesystem-only: after you resume, the next pause() takes a full memory snapshot again unless you pass it once more. The older keepMemory: false / keep_memory=False form still works and means the same as mode: 'filesystem' / mode="filesystem"; it is deprecated, and a call that passes both options is rejected with InvalidArgumentError / InvalidArgumentException.

Auto-pause filesystem-only

You can also make the timeout-driven auto-pause filesystem-only. Set onTimeout / on_timeout to the object form and include mode:
When this sandbox times out, it auto-pauses filesystem-only; the next explicit resume reboots it. See Auto-resume on request for the full lifecycle reference.

Type safety and validation

mode only governs a pause action, so the SDK rejects nonsensical combinations:
  • It cannot be set when the action is kill. In TypeScript this is a compile-time type error (the onTimeout object is a discriminated union on action); in Python it raises InvalidArgumentException.
  • It cannot be combined with auto-resume. A filesystem-only snapshot can’t be woken by inbound traffic (auto-resume restores the running process from memory, which a filesystem-only snapshot doesn’t have), so it must be resumed explicitly with connect(). Setting mode: 'filesystem' / mode="filesystem" together with autoResume: true / auto_resume=True is rejected client-side.
  • mode and the deprecated keepMemory / keep_memory cannot be passed together.
A filesystem-only snapshot is not compatible with auto-resume. Resume it explicitly via connect() — it will not wake on traffic.

What changes on resume

Resuming a filesystem-only snapshot, or creating a sandbox from one, is a reboot from disk rather than the near-instant in-place memory restore. Any service running inside the sandbox must be started again, and clients must reconnect.
Expect the boot to take several seconds. A filesystem-only snapshot is a new build that no node has cached yet, so the first sandboxes started from it read the root filesystem from storage block by block while booting. The boot also runs the template’s own startup units, so a template whose boot is slow stays slow here.
Because resume is a reboot, anything that lived only in memory is gone, while everything written to disk persists. The example below writes a file and starts a background process, pauses filesystem-only, then resumes: the file is still there, but the process is not.

Picking up envd updates

envd is E2B’s in-sandbox daemon. The envd version a sandbox runs is pinned by its template, so by default a long-lived paused sandbox stays on that version for its whole lifetime and does not pick up later envd fixes and improvements. A filesystem-only resume reboots the sandbox from disk, and that reboot can bring the sandbox up on a newer envd than its template shipped. The filesystem is untouched. This is how a long-lived sandbox can adopt envd improvements - for example around memory management, stability, and speed - without losing the data on disk. To move an existing sandbox onto a newer envd:
  1. Resume the sandbox.
  2. Pause it filesystem-only with mode: 'filesystem' (JavaScript) / mode="filesystem" (Python).
  3. Resume it again. This reboot can bring it up on a newer envd.
A sandbox has to be resumable to use this flow. A sandbox whose snapshot already fails to resume cannot be paused filesystem-only in the first place, so it cannot be upgraded this way.