Create a Sandbox

Updated at:

Use the CLI to create an FC Agent Sandbox instance from a specified template and attach to an interactive terminal. This is useful for local validation of templates, commands, and network access.

e2b sandbox create <template>

For example, create a sandbox from the base template:

e2b sandbox create base

This command:

  1. Creates a new sandbox from the specified template.

  2. Connects your local terminal to that sandbox.

  3. Keeps the sandbox running while the terminal session is active.

  4. Automatically terminates the sandbox after you exit the terminal.

If you need to create a sandbox and manage its lifecycle in business code, use the SDK Sandbox.create(). CLI parameters may differ across versions, so check the help output before running the command:

e2b sandbox create --help