Environment Variable Naming Convention
OpenHands follows a consistent naming pattern for environment variables:- Core settings: Direct uppercase mapping (e.g.,
debug→DEBUG) - LLM settings: Prefixed with
LLM_(e.g.,model→LLM_MODEL) - Agent settings: Prefixed with
AGENT_(e.g.,enable_browsing→AGENT_ENABLE_BROWSING) - Sandbox settings: Prefixed with
SANDBOX_(e.g.,timeout→SANDBOX_TIMEOUT) - Security settings: Prefixed with
SECURITY_(e.g.,confirmation_mode→SECURITY_CONFIRMATION_MODE)
Core Configuration Variables
These variables correspond to the[core] section in config.toml:
LLM Configuration Variables
These variables correspond to the[llm] section in config.toml:
AWS Configuration
Agent Configuration Variables
These variables correspond to the[agent] section in config.toml:
Sandbox Configuration Variables
These variables correspond to the[sandbox] section in config.toml:
Sandbox Environment Variables
Variables prefixed withSANDBOX_ENV_ are passed through to the sandbox environment:
Security Configuration Variables
These variables correspond to the[security] section in config.toml:
Debug and Logging Variables
Runtime-Specific Variables
Docker Runtime
Docker Conversation Runtime (Canvas)
When running Agent Canvas locally via thedev-safe.mjs launcher, Canvas can forward conversation-runtime settings to its bundled Agent Server. This enables OH_CONVERSATION_RUNTIME=docker, which runs each conversation in an isolated Docker container instead of the default local process runtime.
Canvas forwards these settings only when the operator explicitly sets them. Unset values remain absent so Agent Server defaults stay authoritative.
These variables are specific to Canvas’s
dev-safe.mjs launcher and are forwarded to the bundled Agent Server process. Docker provisioning and setting interpretation are handled by Agent Server.
Remote Runtime
Local Runtime
Integration Variables
Git Provider Access
When running OpenHands with Docker, set this on the OpenHands server container:
GitHub Integration
Third-Party API Keys
Server Configuration Variables
These are primarily used when running OpenHands as a server:Deprecated Variables
These variables are deprecated and should be replaced:Usage Examples
Basic Setup with OpenAI
Docker Deployment with Custom Volumes
Remote Runtime Configuration
Security-Enhanced Setup
Notes
-
Boolean Values: Environment variables expecting boolean values accept
true/false,1/0, oryes/no(case-insensitive). -
List Values: Lists should be provided as Python literal strings, e.g.,
AGENT_DISABLED_MICROAGENTS='["skill1", "skill2"]'. -
Dictionary Values: Dictionaries should be provided as Python literal strings, e.g.,
SANDBOX_RUNTIME_STARTUP_ENV_VARS='{"KEY": "value"}'. - Precedence: Environment variables take precedence over TOML configuration files.
-
Docker Usage: When using Docker, pass environment variables with the
-eflag: - Validation: Invalid environment variable values will be logged as errors and fall back to defaults.

