# Boxes

> Create, pause, resize, move, and delete boxes: dedicated Linux machines from Nano to Extra Large.

URL: https://prized.dev/docs/boxes

## Create [#create]

```bash
prized box new                                   # a fruit name, the size your balance runs comfortably
prized box new mango --size Small --ttl 4h --wait
```

Create from the CLI (flags under [CLI: box new](https://prized.dev/docs/cli#box-new)) or the dashboard's [New box](https://prized.dev/docs/dashboard#new-box) page. A Small box with no name, snapshot, or environment is usually running when the create returns; any other new box usually boots in under a minute, a box restored from a snapshot or forked takes minutes, and `--wait` blocks until it is running.

Sizes mix freely, each at its own rate ([Billing](https://prized.dev/docs/billing)); a size your balance could not run for four hours cannot be picked unless [overage](https://prized.dev/docs/billing#overage) is on. `prized box ls` lists your boxes, `prized box info mango` shows one in full, and [Machines](https://prized.dev/docs/machines) says what each size is made of.

## States [#states]

| State            | Meaning                                                                                                    |
| ---------------- | ---------------------------------------------------------------------------------------------------------- |
| running          | Up and reachable, except briefly after a failed restart (see [Resize](#resize)).                           |
| provisioning     | Being created or booted. Usually under a minute; minutes for a restore or a fork.                          |
| suspended        | Paused. Compute is stopped; the disk stays.                                                                |
| waking           | Coming back from a pause.                                                                                  |
| deep sleep       | Suspended over 14 days: the disk is parked as a snapshot. Waking takes minutes.                            |
| resizing         | Changing size. Returns to running, or to suspended if paused.                                              |
| migrating        | Moving to another region; see [Regions](#regions).                                                         |
| degraded         | The box stopped reporting; it reboots itself.                                                              |
| provision failed | Never came up; the reason is in its events. Costs nothing and cannot be woken: delete it and create again. |

## Pause and resume [#pause-and-resume]

```bash
prized box pause mango
prized box resume mango --wait
```

The disk survives a pause (files, tools, git state), and billing drops to the sleep rate at once. Running processes depend on the size:

| Size               | On pause                                                                                                    |
| ------------------ | ----------------------------------------------------------------------------------------------------------- |
| Nano through Small | **Memory snapshot** (hibernate). Processes, tmux sessions, and half-finished builds resume where they were. |
| Medium and larger  | **Clean stop.** Files survive; processes restart on resume.                                                 |

`prized ssh` wakes a suspended box on connect. A box's [desktop](https://prized.dev/docs/desktop) follows the same table.

## Auto-pause [#auto-pause]

Set per box: **Auto-pause** on the box's dashboard page (30 minutes to 24 hours), `prized box auto-pause mango 2h` (up to 7 days), or `prized box new --auto-pause 45m`. The box pauses itself once nothing has used it for that long. Off by default, and a plan feature: boxes on the [free credit](https://prized.dev/docs/billing#free-credit) never pause themselves, and setting a window on one answers `409 trial_no_auto_pause`.

* **Counts as use:** typing or output in any terminal session, sustained CPU (builds, agents, test loops), sustained network traffic. A forgotten shell prompt does not.
* **The 30 minute floor** is how long the box waits before calling itself idle; the box page shows the idle time so far.
* **It is exactly a pause**, shown in the event list as `reconciler:auto_pause`.
* **A workspace policy can cap the window** ([auto-pause floor](https://prized.dev/docs/teams#policies)); [quiet hours](https://prized.dev/docs/teams#quiet-hours) pause the whole workspace nightly.

## Pause deadline [#pause-deadline]

```bash
prized box new ci-run --ttl 2h          # pauses two hours from now
prized box extend mango --ttl 12h       # set, or push back, the deadline
prized box extend mango --no-deadline
```

A deadline pauses the box at a set time, busy or idle: `--ttl` at create, `prized box extend` later, or **Pause at** on the box page's **Settings** tab, 5 minutes to 30 days ahead.

* **One pause, not a schedule.** It clears when it fires or the box wakes. A new `--ttl` replaces it, counting from now; `--no-deadline` removes it.
* **It needs a running box** to set; clearing is always allowed.
* **It stacks with auto-pause:** whichever comes first pauses the box. The event list shows it as `reconciler:pause_deadline`.

## Resize [#resize]

```bash
prized box resize mango Medium
```

The box stops, changes size, and starts again with files intact, metered at the new rate from that moment; it stays `resizing` until it is ready to connect. Any size your balance can keep running is allowed.

| Case                                     | What happens                                                                                                                                                                                                                                                                                                                                            |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Sizing up                                | The disk grows in the same restart. Rarely, a just-grown disk must wait about six hours to grow again; the resize still lands and the space appears on the next restart, unless the new size has more memory than the disk. Then the box restarts at its old size, shown as `reconciler:resize_rolled_back` in its events; resize again after the wait. |
| Sizing down                              | The disk stays as it is (disks never shrink) and keeps costing its own sleep rate.                                                                                                                                                                                                                                                                      |
| A suspended box                          | Resizes fine and takes the new size when it next starts.                                                                                                                                                                                                                                                                                                |
| A box creating, resizing, or moving      | Refused.                                                                                                                                                                                                                                                                                                                                                |
| The restart fails                        | The box can briefly show `running` before `degraded`; it is not ready to connect.                                                                                                                                                                                                                                                                       |
| A bigger disk than the size normally has | Priced with that disk, so the resize check quotes what you will actually pay.                                                                                                                                                                                                                                                                           |

## Regions [#regions]

Boxes run in US West (Oregon), the default, US West (N. California), US East (N. Virginia), US East (Ohio), and Europe (Frankfurt); [Machines](https://prized.dev/docs/machines#regions) lists their ids and CLI names. The dashboard and the onboarding tour start a new box in the region nearest you, with **Region** on the [New box](https://prized.dev/docs/dashboard#new-box) form to pick another: its menu lists every region fastest first, by the round trip timed from your browser. The CLI and API default to Oregon; pick one with `prized box new --region eu-central-1` or `"region": "us-east-1"` on [`POST /api/v1/boxes`](https://prized.dev/docs/api#boxes). A box a plan starts runs in the region picked with its size ([Billing](https://prized.dev/docs/billing#choosing-and-changing-the-plan)); a box restored from a snapshot starts in the snapshot's region. Move an existing box with **Region** on the box page or `prized box move mango us-east-1`.

* **The box stays up while the disk copies**, then goes offline for a few minutes and returns in the new region with its name, files, tools, vars, and secrets. Its public IP changes; `prized ssh` follows it.
* **Metering continues at the normal rate**, and a size costs the same in every region.
* **Only a running box moves**, one move at a time. A move that cannot finish leaves the box in its original region on its original disk.
* **One move per box in 24 hours**, and **three per workspace**, counting only moves that ran; moving needs a funded balance. For a new box, create it in the other region instead.
* **A region holds the box, not the account.** The box's disk, snapshots, and daily backups stay in its region. Your account, box settings, and [command history](https://prized.dev/docs/exec#command-history) are kept in the US (`us-west-2`), and the web terminal and [shared port](https://prized.dev/docs/ports) links pass through there too; `prized ssh` connects to the box directly.
* **Outside Oregon a new box always boots fresh**, which takes a minute or two; in Oregon a Small can start from one already booted.

## Snapshots [#snapshots]

Snapshot a box's disk without stopping it, restore into a new box, fork a running box, save named templates, or set a schedule ([Snapshots](https://prized.dev/docs/snapshots)). Take one before risky changes.

## Infinite storage (alpha) [#infinite-storage-alpha]

Some boxes keep their files in a storage pool that grows on demand instead of a fixed disk. They show an **Alpha - infinite storage** label and their usage instead of a disk size, and work like a local disk, Docker included.

The alpha is opt-in, enabled per workspace by the Prized team: ask us. It runs in US West (Oregon) only; a box created in another region gets a regular disk. On such a box, disk snapshots, forks, templates, and region moves are paused.

If its storage service fails, the box reboots itself and is back in about a minute. Saved files are safe; writes from the last few seconds can be lost, as on a laptop that loses power.

## Environments [#environments]

An environment is what a new box inherits: repos, a setup script, env vars, secret files, and which credentials the box may receive. Pick one at create time or mark a default; a running box keeps its version until you upgrade it ([Environments](https://prized.dev/docs/environments)).

## Several boxes [#several-boxes]

Every box has a hostname: a fruit name unless you pick one (lowercase letters, digits, and hyphens, up to 32 characters). `prized ssh mango` connects to any box.

The **default box** is the one `prized setup` connected first (or `prized login`, when your account had exactly one), used when a command names no box. Other boxes are reachable by name; connect one with `--box` for sync, mirrored ports, and every other command.

```bash
prized setup --box mango            # connect a second box: its own config and daemon
prized --box mango status           # aim any command at it
PRIZED_BOX=mango prized sync ls     # the same from the environment
```

* **Adding a box.** `prized setup --box mango` writes `boxes/mango.toml`, starts its daemon, and runs the normal setup; `prized init --box mango` only connects. With no default box yet, either makes the box the default.
* **Aiming commands.** `--box NAME` (or `PRIZED_BOX`) works on every command, by hostname, or by box id for `setup` and `init`. `--config PATH` overrides everything, as an escape hatch.
* **Changing the default.** `prized init --force --box mango` rewrites the default config (backed up first) and restarts the default daemon. A box with its own file is refused: first `prized --box mango daemon uninstall` and delete `boxes/mango.toml`.
* **Same-named projects.** Two boxes cannot sync a project under one name; the second `prized sync add` asks for `--name`.
* **The same port on two boxes** shows as `conflicted` in `prized ports ls`; toggle it off on one box, or list it under `[ports].never` in that box's config.

| For a box named `mango` | Where                                                                                                  |
| ----------------------- | ------------------------------------------------------------------------------------------------------ |
| Config                  | `~/.config/prized/boxes/mango.toml`, the same schema as `config.toml`                                  |
| Agent token             | `~/.config/prized/boxes/mango.token`                                                                   |
| WireGuard key           | `~/.config/prized/wg-mango.key`                                                                        |
| Daemon socket and state | `~/Library/Application Support/prized/boxes/mango/prizedd.sock` (macOS and Linux)                      |
| Service                 | launchd `com.hudware.prizedd.mango`, systemd `prizedd-mango.service`, or the `PrizedDaemon-mango` task |
| Log                     | `prizedd-mango.log` in the usual [log folder](https://prized.dev/docs/cli#files)                                         |

On Windows these sit under `%LOCALAPPDATA%\Prized\boxes\`.

## Delete [#delete]

```bash
prized box delete mango        # asks you to type the name; -y skips the prompt
```

> [!WARNING]
> Deleting a box terminates the machine and erases its disk. Anything you synced is already on your machine.

A delete can be undone for 7 days from **Recently deleted** on the **Deleted** tab of the Boxes page, except for a box deleted within an hour of being created or under zero data retention ([Data retention](https://prized.dev/docs/data-retention)).
