---
title: Environment Variables
description: Configure OpenChamber and OpenCode integration with environment variables.
---

# Environment Variables

OpenChamber reads these environment variables at startup. For startup services, `openchamber startup enable` snapshots the current environment by default, so rerun it after changing variables you want the service to use.

## OpenChamber server

### `OPENCHAMBER_HOST`

Bind address for the OpenChamber web server. Use `0.0.0.0` to allow access from other machines.

### `OPENCHAMBER_UI_PASSWORD`

Password for the browser UI. Use this when binding outside localhost, using tunnels, or running behind a reverse proxy.

### `OPENCHAMBER_API_ONLY`

Starts OpenChamber in headless mode when set to `true` or `1`. API routes stay available for desktop and mobile clients, but the browser UI is not served.

### `OPENCHAMBER_DATA_DIR`

Overrides the OpenChamber data directory. The default is `~/.config/openchamber`.

### `OPENCHAMBER_COMPRESS_API`

Controls API response compression. Use `true` or `1` to force it on, `false` or `0` to force it off.

### `OPENCHAMBER_SKIP_API_COMPRESSION`

Disables API response compression when set to `true` or `1`. This takes precedence over `OPENCHAMBER_COMPRESS_API`.

### `OPENCHAMBER_VERBOSE_REQUEST_LOGS`

Enables verbose HTTP request logs when set to `true` or `1`.

### `OPENCHAMBER_UPDATE_API_URL`

Overrides the update-check API endpoint. Most users should leave this unset.

### `OPENCHAMBER_PACKAGE_MANAGER`

Forces the package manager used by update operations when auto-detection is wrong.

## OpenCode server

### `OPENCODE_HOST`

Connects OpenChamber to an existing OpenCode server. The value must be an `http` or `https` origin with an explicit port and no path, query, or hash. `OPENCODE_HOST` takes precedence over `OPENCODE_PORT`.

### `OPENCODE_PORT`

Sets the OpenCode server port. With managed OpenCode this requests the managed port; with `OPENCODE_SKIP_START=true` it connects to an external server on that port.

### `OPENCODE_SKIP_START`

Prevents OpenChamber from starting its own OpenCode server when set to `true`.

### `OPENCHAMBER_OPENCODE_HOSTNAME`

Bind hostname for the OpenCode server managed by OpenChamber. The default is `127.0.0.1`.

### `OPENCODE_BINARY`

Path to the `opencode` executable OpenChamber should run.

### `OPENCODE_CONFIG`

Path to a specific OpenCode config file.

### `OPENCODE_CONFIG_DIR`

Path to a specific OpenCode config directory for agents, skills, snippets, and config discovery.

### `OPENCODE_DATA_DIR`

Custom data directory for the managed OpenCode server.

### `OPENCODE_WSL_DISTRO`

Selects the WSL distro used for OpenCode integration on Windows.

### `OPENCHAMBER_OPENCODE_WSL_DISTRO`

OpenChamber-specific alias for selecting the WSL distro. `OPENCODE_WSL_DISTRO` takes precedence when both are set.

### `OPENCODE_JWT_SECRET`

Secret used to sign UI authentication tokens. Use a long random value for persistent service deployments.

## Terminal and Git

### `OPENCHAMBER_TERMINAL_SHELL`

Shell executable used for OpenChamber terminal sessions.

### `OPENCHAMBER_GIT_BINARY`

Git executable used by OpenChamber Git features.

### `GIT_BINARY`

Alternative Git executable override. Prefer `OPENCHAMBER_GIT_BINARY` for OpenChamber-specific configuration.

### `OPENCHAMBER_GIT_READ_CACHE_TTL_MS`

Time-to-live, in milliseconds, for cached Git-backed file reads. Set `0` to disable this cache while debugging.

## Voice and tunnels

### `OPENAI_API_KEY`

API key used by OpenChamber voice features that call OpenAI-compatible services.

### `OPENCHAMBER_ALLOW_REMOTE_OPENAI_COMPAT_URLS`

Allows remote OpenAI-compatible base URLs for voice features when set to `true` or `1`.

### `NGROK_AUTHTOKEN`

ngrok auth token used by OpenChamber tunnel commands. You can also configure ngrok with `ngrok config add-authtoken <token>`.

## Runtime helpers

### `BUN_BINARY`

Bun executable OpenChamber should use when spawning daemon processes.

### `BUN_INSTALL`

Bun installation root. OpenChamber uses it to find `bin/bun` for daemon startup and updates.

### `VITE_OPENCODE_URL`

Build-time API base URL for the Vite-built web app. Most users should not set it for normal CLI or desktop usage.
