Docs · Guides

Snapshots and fork

A snapshot saves a sandbox's memory and files at one moment. Restore rolls the sandbox back to it. Fork starts a new sandbox from its files.

Snapshots and forkMenu

Take a snapshot

terminal
mat snapshot $ID --name before-migrationsnap-0b9e4a7c21d85f3e6a14mat snapshots $IDsnap-0b9e4a7c21d85f3e6a14	ready	before-migration	412 MiB	froze 240 ms	2026-10-30 09:40
  • A running sandbox is frozen briefly while its memory is written, then keeps running. mat snapshots shows how long it was frozen.
  • A paused sandbox is copied as it is and stays paused.
  • A stopped sandbox has no memory to save. Use it once to boot it first.
  • A sandbox keeps at most 10 snapshots. Delete one with mat snapshot rm $ID SNAPSHOT to take another.
  • Snapshots share unchanged data with the sandbox, so a fresh one is cheap on disk. The size shown counts the shared parts too.

Restore

terminal
mat restore $ID snap-0b9e4a7c21d85f3e6a14sb-4f1c9e27a0b3d5c86e12 is paused at snap-0b9e4a7c21d85f3e6a14; it resumes on its next use

Everything the sandbox did since the snapshot is lost: files and processes go back to how they were. The sandbox keeps its ID and ends paused at the snapshot's moment. Its next use resumes it with the processes it had then. The snapshot is kept, so you can restore it again.

Fork

terminal
NEW=$(mat fork snap-0b9e4a7c21d85f3e6a14)Forking snap-0b9e4a7c21d85f3e6a14...

A fork is a new sandbox with the snapshot's files. It boots fresh, with none of the snapshot's processes: copying memory would give two machines the same random state. It gets a new ID, network address, sandbox certificate authority and secret placeholders, and its machine ID and SSH host keys are reset at first boot.

It takes the source sandbox's size and its idle, egress and secret settings. After that it is independent: change or delete either one without affecting the other. A fork counts as a create, so the create rate limit and your quotas apply. It runs on the same host as the snapshot.

What each operation keeps

What restore, fork and delete keep
OperationFilesProcessesSandbox
RestoreAs in the snapshotAs in the snapshotThe same sandbox and ID, paused
ForkAs in the snapshotNone: it boots freshA new sandbox with its own ID
Delete the sandboxGoneGoneIts snapshots are deleted too

Save points, not backups

Snapshots live on the same host as their sandbox. If that host is lost, the sandbox and its snapshots are lost together, and a snapshot whose files are gone shows failed. Deleting a sandbox deletes its snapshots. Keep what matters in git, or copy it out with mat cp.

Snapshots are not billed yet.

Commands: CLI reference. Routes: API reference.