Overview
Daytona provides automatic lifecycle management to optimize resource usage and costs. Sandboxes can be configured to automatically stop, archive, or delete after periods of inactivity.
Lifecycle Stages
Auto-Stop
Automatically stop sandboxes after a period of inactivity.
Update Auto-Stop Interval
Default Auto-Stop
If not specified, sandboxes use a default auto-stop interval of 15 minutes.
Auto-Archive
Automatically archive sandboxes that have been stopped for a specified period.
Update Auto-Archive Interval
Default Auto-Archive
If not specified, sandboxes use a default auto-archive interval of 7 days (10,080 minutes).
Auto-Delete
Automatically delete sandboxes that have been stopped for a specified period.
Auto-delete permanently removes sandboxes and all their data. This action cannot be undone.
Update Auto-Delete Interval
Default Auto-Delete
By default, auto-delete is disabled (autoDeleteInterval = -1).
Ephemeral Sandboxes
Create sandboxes that are automatically deleted when stopped:
Lifecycle Configuration Examples
Development Environment
CI/CD Pipeline Sandbox
Long-Term Research Environment
Temporary Demo Environment
Activity Refresh
Reset the inactivity timer to prevent auto-stop:
What Counts as Activity?
The following actions reset the inactivity timer:
- SDK operations (file operations, process execution, etc.)
- State changes (start, stop)
- Configuration updates
- Manual activity refresh
Note: Preview URL access does NOT count as activity.
Lifecycle Interval Reference
Time Conversion Helper
Best Practices
-
Development environments: Use moderate auto-stop (30-60 min) to save resources while maintaining convenience.
-
CI/CD sandboxes: Use aggressive auto-delete (ephemeral or short intervals) to minimize costs.
-
Production-like environments: Disable auto-delete and use long archive intervals to preserve important work.
-
Demos and testing: Use ephemeral sandboxes for temporary workloads.
-
Long-running jobs: Call
refreshActivity() periodically to prevent auto-stop during extended operations.
-
Cost optimization: Enable auto-archive and auto-delete for unused sandboxes to reduce storage costs.