You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2025. It is now read-only.
@@ -2240,38 +2240,48 @@ const daytona: Daytona = new Daytona({
2240
2240
title: Sandbox Management
2241
2241
2242
2242
import { Tabs, TabItem } from '@astrojs/starlight/components';
2243
+
import Image from 'astro/components/Image.astro';
2243
2244
2244
2245
Sandboxes are isolated development environments managed by Daytona. This guide covers how to create, manage, and remove Sandboxes using the SDK.
2245
2246
By default, Sandboxes auto-stop after 15 minutes of inactivity and use **1 vCPU**, **1GB RAM**, and **3GiB disk**.
2246
2247
2248
+
## Sandbox Lifecycle
2249
+
2250
+
Throughout its lifecycle, a Daytona Sandbox can have several different states. The diagram below shows the states and possible transitions between them.
2251
+
2252
+
<Fragment set:html={sandboxDiagram} />
2253
+
2254
+
By default, sandboxes auto-stop after `15 minutes` of inactivity and auto-archive after `7 days` of being stopped.
2255
+
2247
2256
## Creating Sandboxes
2248
2257
2249
-
Daytona SDK provides an option to create Sandboxes with default or custom configurations. You can specify the language, [Snapshot](/docs/snapshots), resources, environment variables, and volumes for the Sandbox.
2250
-
By default, the Sandboxes auto-stop after `15 minutes` of inactivity in order to save resources but the timeout can be increased.
2258
+
The Daytona SDK provides an option to create Sandboxes with default or custom configurations. You can specify the language, [Snapshot](/docs/snapshots), resources, environment variables, and volumes for the Sandbox.
2259
+
Running Sandboxes utilize CPU, memory, and disk storage. Every resource is charged per second of usage.
2251
2260
2252
2261
:::tip
2253
-
If you want to prolong the auto-stop interval, you can use the `auto_stop_interval` parameter when creating a Sandbox. The parameter is measured in minutes.
2254
-
2255
-
Setting the auto-stop interval parameter to `0` will disable the auto-stop functionality altogether and allow the sandbox to run indefinitely.
2262
+
If you want to prolong the auto-stop interval, you can [set the auto-stop interval parameter](/docs/sandbox-management#auto-stop-interval) when creating a Sandbox.
2256
2263
:::
2257
2264
2258
2265
### Basic Sandbox Creation
2259
2266
2260
-
Daytona SDK provides methods to create Sandboxes with default configurations, specific languages, or custom labels using Python and TypeScript.
2267
+
The Daytona SDK provides methods to create Sandboxes with default configurations, specific languages, or custom labels using Python and TypeScript.
2261
2268
2262
2269
```python
2263
2270
from daytona import Daytona, CreateSandboxFromSnapshotParams
When Sandboxes are not actively used, it is recommended that they be stopped. This can be done manually [using the stop command](/docs/sandbox-management#stop-and-start-sandbox) or automatically by [setting the auto-stop interval](/docs/sandbox-management#auto-stop-and-auto-archive).
2307
+
2296
2308
:::note
2297
2309
Daytona keeps a pool of warm Sandboxes using default Snapshots.
2298
2310
When available, your Sandbox will launch in milliseconds instead of cold-booting.
To get the preview URL for a specific port, check out [Preview & Authentication](/docs/preview-and-authentication).
2387
2402
2388
-
## Stop & Remove Sandbox
2403
+
## Stop and Start Sandbox
2389
2404
2390
-
Daytona SDK provides methods to stop and delete Sandboxes using Python and TypeScript.
2405
+
The Daytona SDK provides methods to stop and start Sandboxes using Python and TypeScript.
2406
+
2407
+
Stopped Sandboxes maintain filesystem persistence while their memory state is cleared. They incur only disk usage costs and can be started again when needed.
The stopped state should be used when the Sandbox is expected to be started again soon. Otherwise, it is recommended to stop and then archive the Sandbox to eliminate disk usage costs.
2445
+
2446
+
## Archive Sandbox
2447
+
2448
+
The Daytona SDK provides methods to archive Sandboxes using Python and TypeScript.
2449
+
2450
+
When Sandboxes are archived, the entire filesystem state is moved to very cost-effective object storage, making it possible to keep Sandboxes available for an extended period.
2451
+
Starting an archived Sandbox takes more time than starting a stopped Sandbox, depending on its size.
2452
+
2453
+
A Sandbox must be stopped before it can be archived, and can be started again in the same way as a stopped Sandbox.
2454
+
2455
+
```python
2456
+
# Archive Sandbox
2457
+
sandbox.archive()
2458
+
```
2459
+
```typescript
2460
+
// Archive Sandbox
2461
+
await sandbox.archive();
2462
+
```
2463
+
2464
+
## Delete Sandbox
2465
+
2466
+
The Daytona SDK provides methods to delete Sandboxes using Python and TypeScript.
2467
+
2468
+
```python
2469
+
# Delete Sandbox
2470
+
sandbox.delete()
2471
+
```
2472
+
```typescript
2404
2473
// Delete Sandbox
2405
2474
await sandbox.delete();
2406
2475
```
@@ -2435,13 +2504,22 @@ All sandboxes have been deleted
2435
2504
2436
2505
:::
2437
2506
2438
-
## Sandbox States and Persistence
2507
+
## Auto-stop and Auto-archive
2439
2508
2440
-
Daytona keeps the filesystem in its entirety during the Sandbox lifecycle. The persistence functionality is built into the system, and nothing needs to be explicitly done from the user side.
2509
+
Daytona Sandboxes can be automatically stopped and archived based on user-defined intervals.
2441
2510
2442
2511
### Auto-stop Interval
2443
2512
2444
-
It is important to understand the Sandbox states to maintain cost-effectiveness. One useful built-in feature is the auto-stop interval. By default, it triggers after `15 minutes` of inactivity by stopping the Sandbox, but the number can changed to any value, including `0` which disables auto-stopping.
2513
+
The auto-stop interval parameter sets the amount of time after which a running Sandbox will be automatically stopped.
2514
+
2515
+
The parameter can either be set to:
2516
+
2517
+
- a time interval in minutes
2518
+
- `0`, which disables the auto-stop functionality, allowing the sandbox to run indefinitely
2519
+
2520
+
If the parameter is not set, the default interval of `15` minutes will be used.
Another useful built-in feature is the auto-archive interval. By default, it triggers after a Sandbox has been continuously stopped for `7 days` by archiving it, but the number can changed to any value, including `0` which means the maximum interval of `30 days` will be used.
2540
+
The auto-archive interval parameter sets the amount of time after which a continuously stopped Sandbox will be automatically archived.
2541
+
2542
+
The parameter can either be set to:
2543
+
2544
+
- a time interval in minutes
2545
+
- `0`, which means the maximum interval of `30 days` will be used
2546
+
2547
+
If the parameter is not set, the default interval of `7 days` days will be used.
A Daytona Sandbox can have three states during its lifecycle:
2478
-
2479
-
### Running
2480
-
2481
-
Running Sandboxes utilize CPU, memory, and disk storage. Every resource is charged per second of usage. When Sandboxes are not actively used, it is recommended that they be stopped. This can be done:
2482
-
2483
-
- Manually using the stop command
2484
-
- Automatically by setting the autoStop interval
2485
-
2486
-
### Stopped
2487
-
2488
-
Stopped Sandboxes only utilize disk storage. They can be instantly started when needed. The stopped state should be used when the Sandbox is expected to be started again soon. Otherwise, it is recommended to archive the Sandbox to eliminate disk usage costs.
2489
-
2490
-
### Archived
2491
-
2492
-
When Sandboxes are archived, the entire filesystem state is moved to very cost-effective object storage, making it possible to keep Sandboxes available for an extended period.
2493
-
2494
-
### Performance Considerations
2495
-
2496
-
The tradeoff between archived and stopped states is that starting an archived Sandbox takes more time, depending on its size.
2497
-
2498
2562
title: Snapshots
2499
2563
2500
2564
import { TabItem, Tabs } from '@astrojs/starlight/components'
0 commit comments