Skip to main content
A snapshot saves the parts of the disk that you changed. It does not save the operating system that every machine already has.

Saved and not saved

Saved

/home/user: your code, files and settingsEvery other home folder under /home, for example a second Linux userFolders that you create at /, for example /code or /dataDocker named volumes (/var/lib/docker/volumes)Your Docker containers and every tagged Docker image, used by a container or not (read more)Your changes in /etc, /usr, /opt, /root, /srv and /var, with their owners and permissions. This means installed packages, systemd services, system settings, cron tables and the data of databases that you install with apt.

Not saved

The operating system and the tools that come with every machineThe identity of the machine: hostname, IP address, network settings, SSH host keys/tmp and /var/tmp, /var/cache, the journal logs (/var/log/journal) and Docker internals other than volumes. Put files that must survive a stop in /home/user or in a folder that you create at /.Your cache folder ~/.cache, except Playwright browsers and the Deno cache (read more)Running programs, memory and open ports. A resume within 10 minutes of a stop usually gets them back on the same machine (read more)The Docker build cache, and untagged <none> images (read more)
The IP address changes at every resume and fork. To reach a port at a fixed address, use a public URL.

Keep a hostname

A snapshot does not save /etc/hostname, so the hostname changes at every resume and fork. To keep a hostname, set it from an enabled systemd service. Enabled services start again after each resume and fork.
To name a sandbox in boat, set its name instead. The hostname is not used for that.

Deleted files stay deleted

A deletion is a change, so the snapshot saves it too. For example, remove a coding agent that comes with the machine:
The agent stays gone after every resume, fork and deploy from a saved snapshot. The same is true for an apt package that you remove. If you install your own copy of a tool, your copy is used, not the one that comes with the machine.

A restore is like a reboot

When a sandbox comes back from a snapshot, it is like a server that restarts.
  • Your files, packages and system settings are there.
  • Systemd services that you enabled start again by themselves.
  • Docker containers that ran start again by themselves.
  • Programs that you started by hand are not running. Start them again, or make them a service.
  • Snap packages are reinstalled.
Services and containers start a few seconds after the sandbox is ready. Read Readiness and resume speed. To keep a program running across stops, read Keep a sandbox running.

Docker

Docker and BuildKit are installed. This is what a resume, a fork or a deploy from a saved snapshot gets back: A snapshot saves these images at the moment you take it. Do not stop Docker before boat snapshot. After a resume reaches ready, images and containers load in the background. They appear about 2 seconds later. Read Readiness and resume speed. boat pulls the registry images that a container uses from their registry at each resume. A private registry needs its login in the sandbox.

Docker builds

While a sandbox runs, docker build uses its layer cache as usual. A rebuild with no change takes less than one second. The cache is in /var/lib/docker, and a snapshot does not save it. To keep the build cache, save it in your home folder:
We measured this on a Node app with a slow dependency install:

Tool caches

A snapshot does not save ~/.cache. Tools that download files into it download them again after a resume or a fork. Two folders in ~/.cache are saved:
  • ~/.cache/ms-playwright: the Playwright browsers. npx playwright install puts them there by default.
  • ~/.cache/deno: the Deno cache.
To keep the cache of another tool, point that tool at a folder outside ~/.cache.

Leave files out with .boatignore

Build output and dependency folders slow down every restore, and you can make them again. To leave them out of snapshots, write a .boatignore file. The next snapshot uses it.
  • It uses the same rules as .gitignore.
  • Its rules apply to the folder that it is in. A .boatignore in a repo applies to that repo. A .boatignore in your home folder applies to the whole sandbox.
  • boat looks for it up to six folders below your home folder. It does not look inside node_modules, .next, target or vendor.
  • Put the file at the top of the folder that you want to leave out, not inside it.
  • .git is always saved, because you cannot make it again.
  • boat also reads the old names .boxignore and .oneignore. If a folder has more than one, .boatignore wins.
boat does not read your .gitignore. A .gitignore lists files that you do not commit. That is not the same as files that you can lose. Also, a tool that you install with git clone has its own .gitignore. For example, the .gitignore of ~/.nvm lists every Node version that you install.