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

# Configuration Options

> How to configure OpenHands V1 (Web UI, env vars, and sandbox settings).

> [!NOTE]
>
> This page documents the current **V1** configuration model.
>
> Legacy `config.toml` / “runtime” configuration docs have been moved
> to the **Legacy (V0)** section of the Web tab.

## Where configuration lives in V1

Most user-facing configuration is done via the **Settings** UI in the Web app
(LLM provider/model, integrations, MCP, secrets, etc.).

For self-hosted deployments and advanced workflows, OpenHands also supports
environment-variable configuration.

## Common V1 environment variables

These are some commonly used variables in V1 deployments:

* **LLM credentials**
  * `LLM_API_KEY`
  * `LLM_MODEL`

* **Persistence**
  * `OH_PERSISTENCE_DIR`: where OpenHands stores local state (defaults to
    `~/.openhands`).

* **Public URL (optional)**
  * `OH_WEB_URL`: the externally reachable URL of your OpenHands instance
    (used for callbacks in some deployments).

* **Sandbox workspace mounting**
  * `SANDBOX_VOLUMES`: mount host directories into the sandbox (see
    [Docker Sandbox](https://docs.openhands.dev/openhands/usage/sandboxes/docker)).

* **Sandbox image selection**
  * `AGENT_SERVER_IMAGE_REPOSITORY`
  * `AGENT_SERVER_IMAGE_TAG`

* **Sandbox networking (self-hosting behind a reverse proxy)**
  * `SANDBOX_CONTAINER_URL_PATTERN` / `OH_SANDBOX_CONTAINER_URL_PATTERN`:
    the URL pattern used to reach exposed sandbox ports, with  as a
    placeholder (default `http://localhost:{port}`). Set this to your public
    hostname, e.g. `https://my-domain:{port}`, when self-hosting behind a
    reverse proxy. See [Docker Sandbox: Self-hosting behind a reverse proxy](https://docs.openhands.dev/openhands/usage/sandboxes/docker#self-hosting-behind-a-reverse-proxy).
  * `AGENT_SERVER_USE_HOST_NETWORK`: when `true` (also
    `1`/`yes`), run agent-server containers in Docker host-network
    mode so each container's ports are reachable directly on fixed host ports instead of
    randomly assigned ones. See [Docker Sandbox: Self-hosting behind a reverse proxy](https://docs.openhands.dev/openhands/usage/sandboxes/docker#self-hosting-behind-a-reverse-proxy).

## Sandbox provider selection

Some deployments still use the legacy `RUNTIME` environment variable to
choose which sandbox provider to use:

* `RUNTIME=docker` (default)
* `RUNTIME=process` (aka legacy `RUNTIME=local`)
* `RUNTIME=remote`

See [Sandboxes overview](https://docs.openhands.dev/openhands/usage/sandboxes/overview) for details.

## Need legacy options?

If you are looking for the old `config.toml` reference or V0 “runtime”
providers, see:

* **Web → Legacy (V0) → V0 Configuration Options**
* **Web → Legacy (V0) → V0 Runtime Configuration**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.