Skip to main content
A template is a sandbox that you save under a name. This saved copy is a named snapshot. Each new sandbox that you deploy from it starts with the same disk. Use a template when many sandboxes need the same tools. You install the tools one time. You do not install them in each new sandbox.

Automatic and named snapshots

Make a template

  1. Create a sandbox. Install everything: runtimes, packages, your app.
  2. Save it with boat snapshot <id> <name>. This saves the disk as it is now, under the name.
  3. Deploy each new sandbox with boat new --from <name>.
Each deploy is ready in a few seconds. The time and the cost stay about the same, whatever the template holds.
In Python, from is a reserved word. Build this request with from_dict, as above. Do not use keyword arguments.
  • If the sandbox runs, the save takes a new snapshot of its disk. This takes a moment.
  • If the sandbox is stopped, the save uses its last snapshot.
  • boat snapshots shows the size of each named snapshot.

A template does not depend on its sandbox

A named snapshot is a full copy. The source sandbox can change, stop or be deleted. The name still deploys the exact disk that you saved. A named snapshot does not expire.

Update a template

Save the same name again:
  1. Resume the sandbox, or use any sandbox that has the setup you want.
  2. Update your tools.
  3. Run boat snapshot <id> <name> with the same name.
The name now deploys the new disk. Boat removes the old copy. Sandboxes that you already deployed do not change. If the new save fails, the name keeps the last good save.

Templates and environments

A template holds the disk. An environment holds the settings. Most setups use both. A simple rule: what you put in a Dockerfile goes in a template. What you put in a .env file goes in an environment. Use both together:
This sandbox starts with your tools installed, none of your logins, and one variable of its own.
A deploy from a template does not get the named environment of the source sandbox. It gets the environment from --environment, or your default environment. So a template that you built while logged in to your GitHub does not give that access to its deploys.A deploy does get the per-sandbox variables of the source, the same as a fork. Each --env KEY=VALUE that you gave the source is set on every deploy, unless the deploy sends its own env. Do not put a secret in --env on a sandbox that you will save as a template.

Named snapshot pricing

Each account and each organization has 10 free named snapshots. You can keep more. Each named snapshot after the first 10 costs $1.70 a month.
  • Boat takes this cost each day, from your Boat time (about $0.06 a day for each one). Boat uses your plan’s included usage first, then your credit packs. Sandbox time works the same way.
  • When you remove a named snapshot, it stops costing from the next day.
  • A save goes to your active organization, or to the one that you pass with --org. All members of an organization share its 10 free named snapshots.
  • If a member leaves an organization, they keep their named snapshots. These then count on the member’s own account.
  • To save a new named snapshot after the first 10, you need credit. Without credit, the save fails with credit_required.
boat snapshots shows how many named snapshots you keep and their monthly cost. The API gives the same numbers in allowance on GET /named-snapshots.

When your balance is empty

  1. Your sandboxes get the usual grace period.
  2. Your named snapshots after the first 10 get 7 days.
  3. Boat sends you an email. It lists these named snapshots and the date that Boat deletes them. Boat sends a reminder one day before.
  4. If your balance is still empty on that date, Boat deletes them.
Boat never deletes your 10 most recent named snapshots. To cancel the deletion, add funds. You can also remove named snapshots until you have 10 or fewer.

Share a template with another account

A share code lets another Boat account deploy one of your named snapshots. The other account runs boat new --from <code>. The new sandbox is in their account, and they pay for it.
  1. Create the source sandbox.
  2. Install your tools and save them: boat snapshot <id> <name>.
  3. Make a code: boat snapshot share <name>. Give the code to the other account.
  • Boat shows the code one time only, when you make it. Boat keeps only a hash of the code.
  • If you lose a code, revoke it and make a new one.
  • A code has 256 random bits. Nobody can guess it.
Before the other account can use its sandbox, Boat removes these from the disk: your logins and API keys, the secret files of your environment, your repository clones, and your SSH authorized keys.Boat shares everything else on the disk. This includes secrets that you wrote into files yourself.
The other account gets:
  • A sandbox in their account, which they pay for.
  • None of your per-sandbox variables. Their own environment applies, as with any boat new. To use no environment, they send noEnv: true (--no-env).
What happens to a code over time: A wrong or revoked code fails with 404 snapshot_not_found. API keys need these scopes: