Configuration Paths
These variables control where DeerFlow looks for configuration files and data storage.DEER_FLOW_CONFIG_PATH
Path to the main configuration file (
config.yaml).Default Resolution (if not set):- Current working directory:
./config.yaml - Parent directory:
../config.yaml - Error if not found
DEER_FLOW_EXTENSIONS_CONFIG_PATH
Path to the extensions configuration file (
extensions_config.json).Default Resolution (if not set):- Current working directory:
./extensions_config.json - Parent directory:
../extensions_config.json - Backward compatibility:
./mcp_config.json - Empty config if not found (extensions are optional)
DEER_FLOW_HOME
Base directory for DeerFlow’s data storage (memory, threads, agent configs).Default Resolution (if not set):
- If running from
backend/directory:./.deer-flow - Otherwise:
~/.deer-flow
API Keys and Credentials
These variables are referenced in configuration files using the$VARIABLE_NAME syntax.
Model Provider API Keys
OpenAI
Anthropic
DeepSeek
config.yaml:
config.yaml
Tool and Service API Keys
config.yaml and extensions_config.json:
config.yaml
extensions_config.json
Runtime Configuration
These variables affect DeerFlow’s runtime behavior.Python Environment
Python module search path. May be needed if running DeerFlow from a non-standard location.
Development Mode
Enable debug mode for more verbose logging.Values:
"true", "1", "yes" → Enable debugDatabase and Storage
For custom database connections:Sandbox-Specific Variables
These variables are injected into sandbox environments.Container Environment Variables
Configured inconfig.yaml and resolved from host environment:
config.yaml
Variables prefixed with
$ in sandbox configuration are resolved from the host environment when DeerFlow starts.MCP Server Variables
Environment variables for MCP servers (stdio transport):extensions_config.json
OAuth Variables
For MCP servers using OAuth authentication:extensions_config.json:
Setting Environment Variables
Using .env Files (Recommended)
Create a.env file in your project root:
.env
.env files using python-dotenv.
Using Shell Export
Using System Environment (Linux)
override.conf
Using Docker
docker-compose.yml
Using Kubernetes
deployment.yaml
Environment Variable Reference Table
| Variable | Type | Required | Default | Description |
|---|---|---|---|---|
DEER_FLOW_CONFIG_PATH | Path | No | ./config.yaml | Main config file location |
DEER_FLOW_EXTENSIONS_CONFIG_PATH | Path | No | ./extensions_config.json | Extensions config location |
DEER_FLOW_HOME | Path | No | ~/.deer-flow | Data storage directory |
OPENAI_API_KEY | String | No* | - | OpenAI API key |
ANTHROPIC_API_KEY | String | No* | - | Anthropic API key |
GOOGLE_API_KEY | String | No* | - | Google API key |
DEEPSEEK_API_KEY | String | No* | - | DeepSeek API key |
TAVILY_API_KEY | String | No* | - | Tavily search API key |
GITHUB_TOKEN | String | No* | - | GitHub access token |
DEBUG | Boolean | No | false | Enable debug logging |
PYTHONPATH | Path | No | - | Python module search path |
- Required if the corresponding service/model is configured in
config.yamlorextensions_config.json.
Validation and Errors
Missing Required Variables
If a configuration references an undefined environment variable:config.yaml
Security Best Practices
Never Commit Secrets
Never Commit Secrets
Always use
.gitignore to prevent committing sensitive files:Use Secret Management
Use Secret Management
For production, use proper secret management:
- AWS Secrets Manager
- HashiCorp Vault
- Kubernetes Secrets
- Azure Key Vault
Rotate Keys Regularly
Rotate Keys Regularly
Rotate API keys and secrets periodically:
Limit Variable Scope
Limit Variable Scope
Only set variables where needed:
- Development:
.envfile - Production: System/container environment
- CI/CD: Pipeline secrets
Troubleshooting
Environment variable not resolved
Environment variable not resolved
Check the variable is set:
.env file not loaded
.env file not loaded
Ensure DeerFlow uses
.env is in the correct location:python-dotenv which loads .env from the current directory.Docker container can't access host variables
Docker container can't access host variables
Pass variables explicitly in
docker-compose.yml:Next Steps
Configuration Overview
Return to configuration overview
Deployment Guide
Deploy DeerFlow to production