Skip to main content
porter sandbox contains commands for listing, inspecting, executing commands in, and terminating sandboxes in the currently selected Porter project and cluster.
Sandboxes are in a private beta. Please reach out to us at support@porter.run or over Slack if you are interested in joining.

Prerequisites

If the CLI cannot find a selected project or cluster, it asks you to run porter config or pass --project and --cluster.

porter sandbox create

Creates a sandbox from a container image in the current project and cluster. Usage:
Options: Use the positional form after -- for common one-shot commands. Use --command and --arg when scripting individual argv elements. Volume values can be volume names or volume IDs. The CLI resolves names first, then falls back to treating the value as an ID. Sandbox names currently cannot be reused, even after the sandbox is terminated. Omit --name only for one-off sandboxes where you do not need stable lookup later. The sandbox runs as long as its main process. When the process exits, the sandbox moves to succeeded or failed and stops accepting exec calls, so pass a long-running command if you plan to exec into the sandbox. See sandbox lifetime.

porter sandbox list

Lists sandboxes in the current project and cluster. The command auto-paginates through the API and sorts results most-recent-first. Usage:
Options: Phases: Output formats: Plain output includes these columns:

porter sandbox exec

Runs a command in a running sandbox, identified by name. Non-interactive exec prints stdout and stderr; interactive exec opens a shell session. Usage:
Options: Do not combine --command with positional command arguments. Exit codes: Only running sandboxes accept exec calls.

porter sandbox logs

Fetches and prints a batch of log lines for a sandbox. By default, the CLI requests logs from the last hour with a limit of 500 lines. Usage:
Options: Each rendered log line uses this format:

porter sandbox terminate

Terminates one sandbox by name, or terminates many sandboxes with --all. Usage:
Options: Behavior:

porter sandbox volume

Manages persistent volumes that sandboxes can mount at launch. Create a volume first, then reference it from porter sandbox create with --volume <mount_path>=<volume-ref>, where volume-ref is a volume name or ID.

porter sandbox volume list

Lists sandbox volumes in the current project and cluster, sorted most-recent-first. Usage:
Options: Volume phases: Output formats: Plain output includes these columns:

porter sandbox volume create

Creates a persistent volume on the current cluster. The volume name may contain lowercase letters, numbers, and hyphens, and must start and end with a letter or number. Omit the name only for one-off volumes where you do not need stable lookup later. Volumes start in the pending phase. Sandboxes that mount them wait for the underlying claim to bind, so porter sandbox create does not need a separate wait step. Volume names must be unique within a cluster for the lifetime of the volume. After a volume is deleted, its name can be used again. Usage:
Options:

porter sandbox volume get

Shows a single sandbox volume by name, including phase, creation time, and currently attached sandboxes. Usage:
Options:

porter sandbox volume delete

Deletes a sandbox volume by name. Usage:
The server rejects deletion while the volume is attached to any sandbox. Terminate or recreate the attached sandboxes first.

Common Workflows