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

# Configuration

> Configure Petri for self-hosting.

## Environment Variables

| Variable                    | Default               | Description                                             |
| --------------------------- | --------------------- | ------------------------------------------------------- |
| `PETRI_WORKSPACE_ROOT`      | `~/.petri/workspaces` | Root folder for all sandbox workspaces.                 |
| `PETRI_SANDBOX_TTL_SECONDS` | `3600`                | Seconds of inactivity before a sandbox is auto-deleted. |

The SQLite registry is stored at `$PETRI_WORKSPACE_ROOT/registry.db` alongside sandbox workspaces.

## Docker Compose (recommended)

The `docker-compose.yml` sets `PETRI_WORKSPACE_ROOT=/tmp/petri-workspaces` and mounts it automatically. No additional configuration needed.

```bash theme={null}
git clone https://github.com/jhansi-io/petri.git
cd petri
docker compose up
```

<Warning>
  `/tmp/petri-workspaces` is ephemeral — workspaces are cleared when the host restarts. For persistent workspaces, override `PETRI_WORKSPACE_ROOT` with a permanent path and update the volume mount in `docker-compose.yml`.
</Warning>

## Local Development

```bash theme={null}
make run
```

Workspaces are stored at `~/.petri/workspaces` by default.
