Environment variables
| Variable | Description |
|---|---|
PORT | Port (default 4000) |
MOKA_HOST | Bind address (default 127.0.0.1) |
MOKA_TOKEN | Fixed access token |
MOKA_CONFIG | Config file path |
MOKA_HOME | Data directory (default ~/.moka): default config + chat sessions |
MOKA_NO_OPEN | 1 to never open a browser |
MOKA_PUBLIC_URL | The URL browsers use to reach Moka (default http://localhost:<port>). Used for OAuth redirects |
OLLAMA_HOST | Where to look for Ollama on first run (default http://localhost:11434) |
Network
Section titled “Network”| Variable | Description |
|---|---|
HTTPS_PROXY / HTTP_PROXY | Proxy for model providers, HTTP MCP servers and catalog URLs (Node 22.21+ / 24+) |
NO_PROXY | Hosts that bypass the proxy. Local addresses are always added |
NODE_EXTRA_CA_CERTS | Extra root certificates (PEM), e.g. a corporate TLS-inspection CA |
These, plus SSL_CERT_FILE, REQUESTS_CA_BUNDLE, npm_config_registry, PIP_INDEX_URL and UV_INDEX_URL, are passed through to stdio MCP servers. See corporate networks.
Providers detected on first run
Section titled “Providers detected on first run”| Variable | Creates a profile for |
|---|---|
OPENAI_API_KEY | OpenAI |
ANTHROPIC_API_KEY | Anthropic |
GOOGLE_GENERATIVE_AI_API_KEY or GEMINI_API_KEY | Google Gemini |
AZURE_API_KEY + AZURE_RESOURCE_NAME | Azure OpenAI |
OPENROUTER_API_KEY | OpenRouter |
GROQ_API_KEY | Groq |
DEEPSEEK_API_KEY | DeepSeek |
MISTRAL_API_KEY | Mistral |
XAI_API_KEY | xAI |
TOGETHER_API_KEY | Together AI |
Profiles reference the variable (env:OPENAI_API_KEY), so rotating a key only requires restarting Moka with the new value.
Any other variable can be referenced from moka.json with env:NAME or ${NAME}.