Skip to main content
This page provides a reference of environment variables that can be used to configure OpenHands. Environment variables provide an alternative to TOML configuration files and are particularly useful for containerized deployments, CI/CD pipelines, and cloud environments.

Environment Variable Naming Convention

OpenHands follows a consistent naming pattern for environment variables:
  • Core settings: Direct uppercase mapping (e.g., debugDEBUG)
  • LLM settings: Prefixed with LLM_ (e.g., modelLLM_MODEL)
  • Agent settings: Prefixed with AGENT_ (e.g., enable_browsingAGENT_ENABLE_BROWSING)
  • Sandbox settings: Prefixed with SANDBOX_ (e.g., timeoutSANDBOX_TIMEOUT)
  • Security settings: Prefixed with SECURITY_ (e.g., confirmation_modeSECURITY_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 with SANDBOX_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

Remote Runtime

Local Runtime

Integration Variables

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

  1. Boolean Values: Environment variables expecting boolean values accept true/false, 1/0, or yes/no (case-insensitive).
  2. List Values: Lists should be provided as Python literal strings, e.g., AGENT_DISABLED_MICROAGENTS='["skill1", "skill2"]'.
  3. Dictionary Values: Dictionaries should be provided as Python literal strings, e.g., SANDBOX_RUNTIME_STARTUP_ENV_VARS='{"KEY": "value"}'.
  4. Precedence: Environment variables take precedence over TOML configuration files.
  5. Docker Usage: When using Docker, pass environment variables with the -e flag:
  6. Validation: Invalid environment variable values will be logged as errors and fall back to defaults.