> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boat.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Templates and sizing

> Use a saved snapshot as a template: build your stack once and start a sandbox from it for each user. Plan concurrent sandboxes and start limits.

## Use a saved snapshot as a template

Do not install your stack on a new sandbox for each user. Build it once, save it as a saved snapshot, then start each user sandbox from it:

1. Create a sandbox. Install the runtimes, the dependencies and your daemon.
2. Save it: `boat snapshot <id> <name>`. The name keeps this exact disk, also when the source sandbox changes or is deleted.
3. Start a sandbox for each user with `boat new --from <name>`. This takes a few seconds.

```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
boat new                                          # install runtimes, deps, your daemon
boat snapshot <id> web-stack                      # save the disk under a name
boat new --from web-stack --no-env -e TENANT_ID=acme   # per user, a few seconds
```

```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl -sS -X POST "$BOAT_API_BASE/saved-snapshots" \
  -H "Authorization: Bearer $BOAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sandboxId":"bx_23456789","name":"web-stack"}'

curl -sS -X POST "$BOAT_API_BASE/sandboxes" \
  -H "Authorization: Bearer $BOAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"web-stack","noEnv":true,"env":{"TENANT_ID":"acme"}}'
```

```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
await sandbox.saveSavedSnapshot({ sandboxId: "bx_23456789", name: "web-stack" });
// poll getSavedSnapshot({ name: "web-stack" }) until its status is "ready"
const created = await sandbox.create({ from: "web-stack", noEnv: true, env: { TENANT_ID: "acme" } });
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
from boat_sdk.models.saved_snapshot_save_request import SavedSnapshotSaveRequest

sandbox.save_saved_snapshot(SavedSnapshotSaveRequest(sandbox_id="bx_23456789", name="web-stack"))
# poll get_saved_snapshot("web-stack") until its status is "ready"
created = sandbox.create(create_sandbox_request=CreateSandboxRequest.from_dict({
    "from": "web-stack", "noEnv": True, "env": {"TENANT_ID": "acme"},
}))
```

* A sandbox from a saved snapshot gets the whole file system that you saved.
* It is usable in seconds, at an almost constant cost, whatever the snapshot holds.
* It does not get the environment of the source sandbox. Pass `--environment` or `--no-env`.
* 10 saved snapshots are free. Read [Saved snapshots](https://docs.boat.dev/snapshots/templates.md) for the price of more.

Do not use a stopped sandbox and `boat fork` as the template. A fork uses the newest snapshot of its source, so any later change to the source goes into the next fork.

To update the template:

1. Start a sandbox from it, or resume the source sandbox.
2. Change it.
3. Run `boat snapshot <id> web-stack` again. Sandboxes that you already started do not change.

## Sizing

The number of concurrent sandboxes follows your daily active users, not your signups. A rough rule from platforms on boat:

| Signups | Active users on an average day | Concurrent sandboxes |
| - | - | - |
| 10,000 | About 100 | 10 to 100 |

On a launch day, the peak is several times higher.

Plan against two different limits:

| Limit | What it controls |
| - | - |
| Concurrent-sandbox cap of your plan | How many sandboxes exist at the same time |
| Machine start limits | How fast you can start them |

Create, fork and resume each count as one start. So pattern 3 uses starts each time a user comes back, not only at signup.

| Plan | Starts per minute / hour / day | Sandboxes at once |
| - | - | - |
| \$20 | 12 / 60 / 200 | 100 |
| \$100 | 30 / 210 / 840 | 300 |
| \$500 | 65 / 420 / 1,680 | 1,000 |
| \$2000 | 90 / 600 / 2,400 | 2,000 |
| [Free trial](https://docs.boat.dev/free-trial.md) | 5 / 25 / 75 | 2 |

An organization on the \$2000 plan gets these limits times its number of seats. Below it, each extra seat adds 20%. Above a limit, a start fails with `429 rate_limited`. The answer names the `window` that you hit. See [Limits and errors](https://docs.boat.dev/limits.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.