haochen cde9602631
docs: run configuration and migration commands in the backend environment (#6425)
* docs: run configuration and migration commands in the backend environment

* docs: preserve runtime paths and extras in backend commands

---------

Co-authored-by: Zhangchenhao-111 <285911435+Zhangchenhao-111@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-10-07 19:06:59 +08:00

3.6 KiB

Setup Guide

Quick setup instructions for DeerFlow.

Configuration Setup

DeerFlow uses a YAML configuration file that should be placed in the project root directory.

Steps

  1. Navigate to project root:

    cd /path/to/deer-flow
    
  2. Copy example configuration:

    cp config.example.yaml config.yaml
    
  3. Edit configuration:

    # Option A: Set environment variables (recommended)
    export OPENAI_API_KEY="your-key-here"
    
    # Optional: pin the project root when running from another directory
    export DEER_FLOW_PROJECT_ROOT="/path/to/deer-flow"
    
    # Option B: Edit config.yaml directly
    vim config.yaml  # or your preferred editor
    
  4. Verify configuration in the backend environment: Complete the local development installation, including any extras required by your configuration (such as postgres). Run from the repository root. --project backend selects the installed backend environment while keeping relative configuration and runtime paths anchored to this directory; --no-sync retains its installed extras.

    uv run --no-sync --project backend python -c "from deerflow.config import get_app_config; print('✓ Config loaded:', get_app_config().models[0].name)"
    

Important Notes

  • Location: config.yaml should be in deer-flow/ (project root)
  • Git: config.yaml is automatically ignored by git (contains secrets)
  • Runtime root: Set DEER_FLOW_PROJECT_ROOT if DeerFlow may start from outside the project root
  • Runtime data: State defaults to .deer-flow under the project root; set DEER_FLOW_HOME to move it
  • Skills: Skills default to skills/ under the project root; set DEER_FLOW_SKILLS_PATH or skills.path to move them

Configuration File Locations

The backend searches for config.yaml in this order:

  1. Explicit config_path argument from code
  2. DEER_FLOW_CONFIG_PATH environment variable (if set)
  3. config.yaml under DEER_FLOW_PROJECT_ROOT, or the current working directory when DEER_FLOW_PROJECT_ROOT is unset
  4. Legacy backend/repository-root locations for monorepo compatibility

Recommended: Place config.yaml in project root (deer-flow/config.yaml).

If you plan to use Docker/Container-based sandbox (configured in config.yaml under sandbox.use: deerflow.community.aio_sandbox:AioSandboxProvider), it's highly recommended to pre-pull the container image:

# From project root
make setup-sandbox

Why pre-pull?

  • The sandbox image (~500MB+) is pulled on first use, causing a long wait
  • Pre-pulling provides clear progress indication
  • Avoids confusion when first using the agent

If you skip this step, the image will be automatically pulled on first agent execution, which may take several minutes depending on your network speed.

Troubleshooting

Config file not found

# Check where the backend is looking
cd /path/to/deer-flow
uv run --no-sync --project backend python -c "from deerflow.config.app_config import AppConfig; print(AppConfig.resolve_config_path())"

If it can't find the config:

  1. Ensure you've copied config.example.yaml to config.yaml
  2. Verify you're in the project root, or set DEER_FLOW_PROJECT_ROOT
  3. Check the file exists: ls -la config.yaml

Permission denied

chmod 600 config.yaml  # Run from the repository root

See Also