Skip to content
Subs -25% LAUNCH-SUB
Claws -25% LAUNCH-CLAWS

Environment Variables Reference

3 min read Configuration Last updated February 10, 2026

Overview

Environment variables control how your OpenClaw instance connects to services and configures its runtime behavior. Most variables are set automatically by ClawHosters based on your dashboard settings. Some can be customized via SSH for advanced use cases.

Variables Set by ClawHosters

These variables are managed automatically. Changing your dashboard settings updates them on the next config deployment.

Instance Identification

Variable Description Example
OPENCLAW_INSTANCE_ID Unique instance identifier 42
OPENCLAW_CUSTOMER_ID Your customer ID 7
OPENCLAW_TIER Your tier name budget, balanced, pro
OPENCLAW_INSTANCE_NAME The name you gave your instance my-assistant
OPENCLAW_GATEWAY_MODE Gateway operating mode local
OPENCLAW_GATEWAY_TOKEN SHA256-hashed token for web UI auth a1b2c3...

LLM Configuration

Variable Description Set When
LLM_MODE LLM operating mode Always
ANTHROPIC_API_KEY Anthropic API key Anthropic selected
OPENAI_API_KEY OpenAI API key OpenAI selected
OPENROUTER_API_KEY OpenRouter API key OpenRouter selected
GEMINI_API_KEY Google Gemini API key Google selected
DEEPSEEK_API_KEY DeepSeek API key DeepSeek selected

LLM_MODE values:

Value Meaning
none No LLM configured — gateway-only mode
byok Bring Your Own Key — your API key, direct to provider
managed Managed LLM — routed through ClawHosters proxy

When LLM_MODE is managed, the proxy URL is also set:

Variable Value
LLM_PROXY_URL https://llm-proxy.clawhosters.com/v1

Playwright (Browser)

Variable Description Value
PLAYWRIGHT_BROWSERS_PATH Where Chromium is installed /opt/playwright-browsers

This is set in all instances. Chromium is pre-installed in the base snapshot for web automation skills.

Docker Compose Variables

These variables are set in the docker-compose.yml file and affect the container runtime:

Variable Description Budget Balanced Pro
NODE_OPTIONS Node.js memory limit --max-old-space-size=768 --max-old-space-size=1536 --max-old-space-size=3072

The NODE_OPTIONS variable limits the Node.js heap size to prevent the container from running out of memory. It is set based on your tier's Docker memory limit.

Viewing Current Variables

Via Dashboard

Your instance's current environment variables are visible in the instance detail page. Sensitive values (API keys, tokens) are masked.

Via SSH

To see all variables inside the running container:

bash
docker exec openclaw-<id> env

To check a specific variable:

bash
docker exec openclaw-<id> printenv LLM_MODE

Adding Custom Variables

If you need to set custom environment variables (for MCP servers or custom skills):

Temporary (Until Container Restart)

bash
docker exec openclaw-<id> bash -c "export MY_VAR=value && ..."

This does not persist across restarts.

Persistent (Via .env File)

SSH into your instance and edit the .env file:

bash
# On the host (not inside the container)
nano /opt/openclaw/.env

Add your variable:

text
MY_CUSTOM_VAR=some-value

Then restart the container:

bash
cd /opt/openclaw && docker compose restart

Custom variables in .env persist across restarts but are overwritten during a full redeploy from the dashboard. To keep custom variables after redeploy, add them again after each deployment.

Security Notes

  • API keys are stored encrypted in the ClawHosters database
  • Keys are decrypted only during config deployment
  • On the instance, keys exist as plaintext in openclaw.json and environment variables
  • The instance's firewall restricts network access, limiting exposure
  • Never share your instance's .env file or openclaw.json — they contain secrets

Related Documentation