Skip to main content
A stop saves the disk, then removes the machine. A stopped sandbox costs nothing. Run boat resume to get it back.
boat keeps the disk of a stopped sandbox for at least 14 days. After that, an automated retention job can delete it when enabled. The job currently reports candidates without deleting them in production. Once deleted, the sandbox cannot resume or fork. Save a saved snapshot before day 14 if you need the disk longer. Read Keep a stopped sandbox longer than 14 days.
  • There is no pause. A stop removes the virtual machine and keeps a copy of the disk. A resume starts a new machine with that disk.
  • A stop keeps the disk. A resume within 10 minutes usually gets the same machine back, with memory and running programs. Do not count on it. After 10 minutes, memory and running programs are gone. Read Resume within 10 minutes.
  • Every stop saves the disk first: boat stop, auto-stop and a stop for an empty wallet. Only boat stop --force and snapshots off skip the save.
  • To erase the sandbox for good, delete it. Read Delete a sandbox.

State names

The CLI and the dashboard show one set of names. The API and webhooks show another. The API reports a stopped sandbox as archived. The webhook event for a stop is sandbox.archived. The field archiveAfter is the auto-stop time. These are names only. A stopped sandbox is not moved or deleted.

Keep a stopped sandbox longer than 14 days

  • A resume starts the 14 days again from the next stop.
  • A saved snapshot has no scheduled expiry. Save one from a stopped sandbox before day 14.
  • Your plan includes 10 or more saved snapshots. Each one after that costs $0.056 a day from the wallet. Delete it to stop the charge.
To keep the disk of a sandbox that stays stopped a long time, save a saved snapshot before day 14. Then start from the saved snapshot instead of the sandbox:
To pay the least, save the saved snapshot only for sandboxes that are still stopped on day 13. Sandboxes that resume earlier need no saved snapshot. Record the stop time in your app when you call boat stop, and run the save from a daily job.

Wait for the stop in a script

boat stop returns when the stop starts, with state stopping. It does not wait for stopped. To wait, poll boat info until the state is stopped:
With the API, poll GET /sandboxes/{sandboxId} until sandbox.state is archived. A second stop is safe to send: You do not need to wait before a plain boat resume. A resume during stopping takes back the same machine, with no restore. If boat cannot take the machine back, the resume fails with 409 sandbox_stopping. The answer carries a Retry-After header and the stop operation.

Resume within 10 minutes

boat keeps the machine for 10 minutes after the sandbox reads stopped. These 10 minutes are not billed.
  • A plain boat resume in those 10 minutes usually takes back the same machine, with no restore.
  • Memory, running programs, open terminals and the IP address are then still there.
  • boat can release the machine early. The resume then starts a new machine from the snapshot, like a reboot.
  • After 10 minutes, a resume always starts a new machine from the snapshot.
Make your work survive a new machine: run it as an always-on service. Wait for stopped before you resume with a new --type or --environment. Such a resume always starts a new machine.

What a stop does

boat does these steps in this order:
  1. boat runs your pre-stop command, if you have one.
  2. boat stops your Docker containers. Each container gets 30 seconds to exit.
  3. boat takes the last snapshot of the disk.
  4. boat turns off the machine and removes it.
boat does not shut down the operating system. Only Docker containers get a stop signal. Your other programs get no signal. A program that runs during the stop does not run its cleanup code. Its files go into the snapshot as they are at that moment. To clean up, use one of these:
  • Clean up when the sandbox starts again. An enabled systemd service with an ExecStartPre= step runs at every resume. Read Always-on services.
  • Run your own cleanup first, then run boat stop.

Save app state before a stop

Some apps keep recent changes in memory. They write them to disk later. Chrome is an example. Chrome writes new cookies to disk every 30 seconds, or when it closes. If you stop the sandbox a few seconds after a login, the snapshot has the old cookies. A kill signal does not help, because Chrome then exits without saving. To fix this, put a command in the file ~/.boat/pre-stop. boat runs it at every stop, before the last snapshot. The example below closes Chrome. It needs Chrome to have a debug port. Start Chrome with --remote-debugging-port=9222.
A Chrome that you started without the flag does not answer, so the command does not close it. A Chrome that you opened from the desktop is an example. Start it again with the flag. How the pre-stop command runs:
  • It runs as user, in your home folder.
  • It has 60 seconds. After that, boat stops it.
  • It runs on boat stop and on auto-stop.
  • It does not run on boat stop --force. It does not run when you save a saved snapshot.
  • If it fails or takes too long, the stop continues.
  • The file is on the disk. Resumes, forks and saved snapshots keep it.

When a stop is refused

A stop saves the disk first. If the save fails, boat refuses the stop. The sandbox keeps running, so the unsaved work stays on its disk. boat tries again by itself and sends you an email. You do not pay while the stop waits. The billing meter pauses at the first refused stop. Your balance and your invoice both show the pause. You do not need to ask for a refund.
  • The meter stays paused while the stop waits, even if you or your scripts use the sandbox.
  • The meter starts again when the sandbox stops.
  • The meter also starts again when you resume the sandbox, because a resume cancels the stop.
  • If the refused stop was an auto-stop, the meter starts again when you use the sandbox again.
The stop waits until a save works. Then the sandbox stops by itself. If this happens again and again, snapshots fail on that sandbox. The stop error shows the last snapshot error. We get an alert. Also contact us, so that we look at your sandbox.
The boat agent in the sandbox uploads snapshots to boat.dev and to snapshot storage. If you block outbound traffic in the sandbox, let the agent service ascii-agent.service out, or every save fails and every stop is refused. An nftables socket cgroupv2 rule stops to match when the agent restarts, for example on a boat update. Load that rule again each time ascii-agent.service starts.
To stop the sandbox now, run boat stop --force. In the API, send {"force": true} in the body. The reply has "forced": true when boat reads the force. The sandbox stops with its last good snapshot. You lose everything written after that snapshot. After 3 days of failed saves, boat does a forced stop by itself. You then lose everything written after the last good snapshot. boat sends you an email one day before it does this.

Why a sandbox stops by itself

Auto-stop is the most common cause. For every cause and how to check it, read Why did my sandbox stop?.

Stop without saving

To never save a sandbox, turn snapshots off for your account or for one sandbox. boat then never saves it, and a stop erases it.