The BoxLite cloud REST runtime can automatically stop a box after it becomes idle, and restart it on the next user operation. This reuses the existing Stop / Start lifecycle, does not create memory snapshots, and does not introduce a new Paused state.
This guide describes the REST runtimes — the cloud, and
boxlite serve, which sweeps on its own 30s tick. The embedded local runtime runs no sweeper; explicitly configuring these policies returnsUnsupported, and the CLI refuses the two deadline flags before the request is made.
Lifecycle intervals are always in seconds:
| Field | Default | Disable Value | Meaning |
|---|---|---|---|
auto_stop |
900 |
0 |
Wait time before Stop after the last valid activity |
auto_delete |
0 |
0 |
Wait time before deletion after the box successfully stops |
You can set the policy when creating a box:
{
"image": "python:3.13",
"auto_stop": 900,
"auto_delete": 604800
}Setting auto_stop: 0 disables AutoStop; setting auto_delete: 0 disables AutoDelete. When both are enabled, auto_delete must be greater than auto_stop.
The Python, Node.js, C, and Go SDKs can pass both fields at creation time. Box info returns the currently effective second-level values.
AutoStop behaves as follows:
- The box is in
STARTEDand has no pending state transition. - The last valid activity is older than
auto_stop. - The control plane submits
STOPPEDas the desired state and follows the normal Stop flow. - After the VM stops, the box enters the existing
STOPPEDstate.
AutoResume behaves as follows:
- The user issues an Exec, Files, or WebSocket attach operation against a stopped box.
- The control plane submits or joins an existing Start operation.
- The first request waits until the box actually reaches
STARTEDbefore forwarding to the runner. - If startup fails or times out, the request fails directly and is not forwarded to a box that is not yet ready.
The first request pays the cold-start latency. Multiple concurrent requests share the same state transition and wait on the same state event.
AutoDelete starts counting when the box successfully enters STOPPED. After the interval expires, the box is deleted and can no longer be recovered via AutoResume. Manual Stop also starts this timer; changing the policy to 0 cancels future automatic deletion.
| Operation | Refreshes Activity Time | Triggers AutoResume |
|---|---|---|
| Exec, execution status/signal/resize/kill | Yes | Yes |
| Files read/write | Yes | Yes |
| WebSocket attach | Only when real client data frames arrive | Yes |
| Metrics | No | No |
| Port preview and port proxy | No | No |
Metrics and port traffic are considered observability or external service traffic. Continuous metric scrapes, health checks, or traffic to exposed ports will not keep a box running indefinitely, nor will they automatically start a stopped box.
AutoStop does not preserve runtime memory. After Stop:
- Persistent disk and mounted volumes are preserved;
- Memory, processes, and background tasks are not preserved;
- Terminal sessions and network connections are dropped;
- After AutoResume, the runtime environment is rebuilt from the image, persistent disk, and application startup logic.
Data that must survive Stop must be written to persistent disk or volumes. Do not rely on in-memory variables, background processes, or files that have not been flushed to disk.
The purpose of AutoStop is to stop compute resources when idle. Billing still uses the platform's existing metered dimensions:
- CPU
- RAM
- GPU
- Disk
Running compute resources and persistent storage kept after Stop are different dimensions. Specific prices, free tiers, and billing rules depend on the deployment environment's billing page and commercial terms; this guide does not promise fixed pricing.
This is expected. Metrics are not considered user workload activity; otherwise monitoring systems would prevent AutoStop.
Port proxies do not count as activity. If a service needs to stay running, disable AutoStop or manage the lifecycle through real Exec / Files / attach workflows.
No. AutoResume is a Start, not a memory restore. Applications must be able to restart normally.
Yes. In that case AutoDelete will not actively stop a running box, but a manually stopped box will still be deleted according to auto_delete.