Overview
Sandbox commands allow you to create, manage, and interact with Daytona sandboxes. All sandbox subcommands are available both asdaytona sandbox [command] and as top-level shortcuts like daytona create.
daytona create
Create a new sandbox.Usage
Flags
Snapshot & Image Options
--snapshot- Snapshot to use for the sandbox--dockerfile,-f- Path to Dockerfile for Sandbox snapshot--context,-c- Files or directories to include in the build context (can be specified multiple times)
--snapshot and --dockerfile/--context are mutually exclusive.
Basic Configuration
--name- Name of the sandbox--user- User associated with the sandbox--env,-e- Environment variables (format:KEY=VALUE, can be specified multiple times)--label,-l- Labels (format:KEY=VALUE, can be specified multiple times)--public- Make sandbox publicly accessible
Resource Allocation
--class- Sandbox class type (small, medium, large)--target- Target region (eu, us)--cpu- CPU cores allocated to the sandbox--gpu- GPU units allocated to the sandbox--memory- Memory allocated to the sandbox in MB--disk- Disk space allocated to the sandbox in GB
Auto-Management
--auto-stop- Auto-stop interval in minutes (default: 15, 0 means disabled)--auto-archive- Auto-archive interval in minutes (default: 10080, 0 means the maximum interval will be used)--auto-delete- Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping, default: -1)
Volumes
--volume,-v- Volumes to mount (format:VOLUME_NAME:MOUNT_PATH, can be specified multiple times)
Network Security
--network-block-all- Block all network access for the sandbox--network-allow-list- Comma-separated list of allowed CIDR network addresses
Examples
Output
When successfully created, the command displays:- Sandbox name
- SSH connection command
- Web terminal URL
daytona list
List all sandboxes in your organization.Usage
Flags
--page,-p- Page number for pagination (starting from 1, default: 1)--limit,-l- Maximum number of items per page (default: 100)--format- Output format (json, yaml)
Examples
Output
Displays a table with:- Sandbox name
- Status (Running, Stopped, etc.)
- Created date
- Resources (CPU, Memory, Disk)
daytona info
Get detailed information about a specific sandbox.Usage
Flags
--format- Output format (json, yaml)
Examples
daytona start
Start a stopped sandbox.Usage
Examples
Output
daytona stop
Stop a running sandbox.Usage
Examples
Output
daytona delete
Delete one or more sandboxes.Usage
Flags
--all,-a- Delete all sandboxes
Examples
Output
daytona ssh
Establish an SSH connection to a running sandbox.Usage
Flags
--expires- SSH access token expiration time in minutes (default: 1440, which is 24 hours)
Examples
Notes
- The sandbox must be in a started state
- An SSH access token is automatically created and used for the connection
- The connection uses your system’s SSH client
daytona exec
Execute a command in a running sandbox without opening an interactive session.Usage
Flags
--cwd- Working directory for command execution--timeout- Command timeout in seconds (0 for no timeout, default: 0)
Examples
Notes
- The sandbox must be in a started state
- The command output (stdout and stderr) is printed to the console
- The exit code of the command is returned
- Use
--to separate sandbox identifier from the command
daytona archive
Mark a sandbox for archival.Usage
Examples
Output
daytona preview-url
Get a signed preview URL for accessing a specific port on a sandbox.Usage
Flags
--port,-p- Port number to get preview URL for (required)--expires- URL expiration time in seconds (default: 3600)