> ## Documentation Index
> Fetch the complete documentation index at: https://docs.idyl.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Sandbox

> Create, inspect, apply, and delete a disposable Linux environment.

Use a Sandbox when you need a disposable Linux environment inside an IDYL subnet.
Every Sandbox has a required TTL. IDYL removes the Sandbox after the TTL expires
unless you delete it earlier.

## 1. Create a Sandbox

Create a Sandbox from an image, TTL, and subnet:

```bash theme={null}
idyl create sandbox --image ubuntu:24.04 --ttl 2h --subnet <subnet>
```

If you omit `--name`, the CLI generates a concrete Sandbox name before creating
the resource.

Output similar to:

```text theme={null}
✓ Sandbox ubuntu-24-04-sandbox-a1b2c3 created
  ubuntu:24.04 · subnet <subnet>
```

Use `--name` when you want to choose the resource name:

```bash theme={null}
idyl create sandbox --name dev --image ubuntu:24.04 --ttl 2h --subnet <subnet>
```

TTL values are duration strings such as `15m`, `2h`, or `24h`.

## 2. Request an isolation class

Use `--isolation-class` when the target subnet allows the requested isolation
class:

```bash theme={null}
idyl create sandbox \
  --name dev \
  --image ubuntu:24.04 \
  --ttl 2h \
  --subnet <subnet> \
  --isolation-class microvm
```

Supported public values are `container` and `microvm`. The value maps to the
Sandbox pod template and must be admitted by the target subnet.

## 3. Inspect Sandboxes

List Sandboxes in the current namespace:

```bash theme={null}
idyl get sandboxes
```

Inspect one Sandbox:

```bash theme={null}
idyl get sandbox dev
```

When available, Sandbox status includes the associated pod for the environment.
Use structured output when a script needs the resource:

```bash theme={null}
idyl get sandbox dev -o yaml
```

## 4. Apply a Sandbox manifest

Use a manifest when the Sandbox definition should be repeatable. Manifest
workflows require `metadata.name`.

```yaml theme={null}
kind: Sandbox
metadata:
  name: dev
  subnet: <subnet>
spec:
  ttl: 2h
  template:
    spec:
      containers:
        - name: main
          imageURI: ubuntu:24.04
          command: ["sleep", "infinity"]
      isolation:
        class: microvm
```

Apply the manifest:

```bash theme={null}
idyl apply -f sandbox.yaml
```

You can also provide the subnet for one command:

```bash theme={null}
idyl apply -f sandbox.yaml --subnet <subnet>
```

## 5. Delete the Sandbox

Delete a Sandbox before its TTL expires:

```bash theme={null}
idyl delete sandbox dev
```

## Related pages

* [Sandboxes](/concepts/sandboxes)
* [Use a manifest](/build/use-a-manifest)
* [Workloads](/resources/workloads)
* [Sandbox reference](/resources/reference/generated/sandbox)
