Skip to main content

sandbox command group

note

Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.

The sandbox command group within the Databricks CLI helps you create, configure, and access Databricks Sandbox environments.

Databricks Sandbox environments are SSH-accessible development environments backed by microVM isolation. Each sandbox is a personal environment with preinstalled tooling (Python, Node.js, Rust, and Databricks CLI) and persistent storage.

To get started:

Bash
databricks auth login --host https://...
databricks sandbox register
databricks sandbox create
databricks sandbox ssh

databricks sandbox config

Configure a sandbox's name and auto-stop policy.

The --name, --idle-timeout, and --no-autostop settings are independent, and you can pass any combination.

databricks sandbox config <sandbox-id> [flags]

Arguments

<sandbox-id>

    The ID of the sandbox to configure.

Options

--name string

    Label for the sandbox (max 256 bytes). Pass --name= to clear.

--idle-timeout string

    Idle timeout duration. Set this value to 0 (or 0s) to clear it and use the manager default (10m). Valid range: 1m to 24h.

--no-autostop

    When true, this sandbox never auto-stops on idle. Pass --no-autostop=false to revert.

Global flags

Examples

Bash
databricks sandbox config my-sandbox-1234 --name my-project
databricks sandbox config my-sandbox-1234 --idle-timeout 15m
databricks sandbox config my-sandbox-1234 --idle-timeout 1h30m
databricks sandbox config my-sandbox-1234 --idle-timeout 0
databricks sandbox config my-sandbox-1234 --no-autostop
databricks sandbox config my-sandbox-1234 --no-autostop=false
databricks sandbox config my-sandbox-1234 --idle-timeout 30m --no-autostop=false

databricks sandbox create

Create a new sandbox environment.

Creates a personal development environment backed by a microVM, blocks until the sandbox is running, and prints the sandbox ID.

databricks sandbox create [flags]

Options

--json

    Return results in JSON format.

--name string

    Label for the sandbox (max 256 bytes).

Global flags

Examples

Bash
databricks sandbox create
databricks sandbox create --name my-project
databricks sandbox create --json

databricks sandbox default

Set the default sandbox used by databricks sandbox ssh.

The default is stored locally in ~/.databricks/sandbox.json per profile. The sandbox ID is validated against the server before being written.

databricks sandbox default <sandbox-id> [flags]

Aliases: set-default

Arguments

<sandbox-id>

    The sandbox ID to set as default.

Options

Global flags

Example

Bash
databricks sandbox default my-sandbox-1234

databricks sandbox delete

Delete a sandbox environment.

This permanently terminates and removes the specified sandbox. The command prompts for confirmation interactively; use --auto-approve to skip the prompt.

databricks sandbox delete <sandbox-id> [flags]

Arguments

<sandbox-id>

    The sandbox ID to delete.

Options

--auto-approve

    Skip the interactive confirmation prompt.

Global flags

Examples

Bash
databricks sandbox delete my-sandbox-1234
databricks sandbox delete my-sandbox-1234 --auto-approve

databricks sandbox list

List your sandbox environments.

Shows all sandboxes associated with your account, including their current status and ID.

databricks sandbox list [flags]

Options

--json

    Return results in JSON format.

Global flags

Examples

Bash
databricks sandbox list
databricks sandbox list --json

databricks sandbox register

Generate a dedicated SSH key for sandbox and register it with the service.

This command:

  1. Generates an Ed25519 SSH key at ~/.ssh/sandbox_ed25519 (if it does not exist).
  2. Registers the public key with the sandbox service, labeled with --name.
  3. Optionally update ~/.ssh/config with a Host sandbox-gw entry.

After registration, databricks sandbox ssh uses this key automatically.

databricks sandbox register [flags]

Options

--name string

    Label for the registered key (defaults to this machine's hostname). Pass --name= to register without a label.

Global flags

Examples

Bash
databricks sandbox register
databricks sandbox register --name my-laptop

databricks sandbox ssh

SSH to your default or a specific sandbox environment. Extra arguments after -- are passed directly to ssh.

databricks sandbox ssh [sandbox-id] [-- <ssh-args-or-command>...] [flags]

Arguments

[sandbox-id]

    Optional sandbox ID. If omitted, uses your default sandbox.

Options

--gateway string

    Sandbox gateway hostname (auto-detected from profile if empty).

--port string

    Sandbox gateway SSH port. Default: 2222.

Global flags

Examples

Bash
databricks sandbox ssh
databricks sandbox ssh my-sandbox-1234
databricks sandbox ssh -- ls -la /home
databricks sandbox ssh my-sandbox-1234 -- cat /etc/os-release
databricks sandbox ssh -- -L 8080:localhost:8080

databricks sandbox ssh-key

Manage SSH keys registered with the sandbox service.

databricks sandbox ssh-key [command]

Available commands

Options

Global flags

databricks sandbox ssh-key list

List SSH keys registered with the sandbox service.

Each row shows the server-assigned key hash (used to delete the key), the user-supplied name, and create and last-use timestamps. The locally registered key (from databricks sandbox register) is marked when its hash matches one of the listed entries.

databricks sandbox ssh-key list [flags]

Options

--json

    Return results in JSON format.

Global flags

Examples

Bash
databricks sandbox ssh-key list
databricks sandbox ssh-key list --json

databricks sandbox ssh-key delete

Delete an SSH key registered with the sandbox service.

The key hash is the identifier returned by databricks sandbox ssh-key list. After deletion, SSH attempts that use the corresponding private key do not succeed until you register the key again.

databricks sandbox ssh-key delete <key-hash> [flags]

Arguments

<key-hash>

    The key hash to delete.

Options

Global flags

Example

Bash
databricks sandbox ssh-key delete a1b2c3d4e5f6...

databricks sandbox start

Turn on a stopped sandbox environment.

Boots the backing microVM and blocks until the sandbox reaches Running (or up to 10 minutes). Running this command on an already running sandbox is a no-op.

databricks sandbox start <sandbox-id> [flags]

Arguments

<sandbox-id>

    The sandbox ID to turn on.

Options

Global flags

Example

Bash
databricks sandbox start my-sandbox-1234

databricks sandbox status

Show detailed status of a sandbox environment.

databricks sandbox status <sandbox-id> [flags]

Arguments

<sandbox-id>

    The sandbox ID to inspect.

Options

--json

    Return results in JSON format.

Global flags

Examples

Bash
databricks sandbox status my-sandbox-1234
databricks sandbox status my-sandbox-1234 --json

databricks sandbox stop

Stop a running sandbox environment.

Terminates the backing microVM but preserves the sandbox record and its persistent storage. Stopping an already stopped sandbox is a no-op.

databricks sandbox stop <sandbox-id> [flags]

Arguments

<sandbox-id>

    The sandbox ID to stop.

Options

Global flags

Example

Bash
databricks sandbox stop my-sandbox-1234

Global flags

--debug

  Whether to enable debug logging.

-h or --help

    Display help for the Databricks CLI or the related command group or the related command.

--log-file string

    A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.

--log-format format

    The log format type, text or json. The default value is text.

--log-level string

    A string representing the log format level. If not specified then the log format level is disabled.

-o, --output type

    The command output type, text or json. The default value is text.

-p, --profile string

    The name of the profile in the ~/.databrickscfg file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT is used.

--progress-format format

    The format to display progress logs: default, append, inplace, or json

-t, --target string

    If applicable, the bundle target to use