Thank you for your interest in contributing to DeerFlow! This guide will help you set up your development environment and understand our development workflow.
We offer two development environments. Docker is recommended for the most consistent and hassle-free experience.
Docker provides a consistent, isolated environment with all dependencies pre-configured. No need to install Node.js, Python, or nginx on your local machine.
- Docker Desktop or Docker Engine
- pnpm (for caching optimization)
-
Configure the application:
# Copy example configuration cp config.example.yaml config.yaml # Set your API keys export OPENAI_API_KEY="your-key-here" # or edit config.yaml directly
-
Initialize Docker environment (first time only):
make docker-init
This will:
- Build Docker images
- Install frontend dependencies (pnpm)
- Install backend dependencies (uv)
- Share pnpm cache with host for faster builds
-
Start development services:
make docker-start
make docker-startreadsconfig.yamland startsprovisioneronly for provisioner/Kubernetes sandbox mode.All services will start with hot-reload enabled:
- Frontend changes are automatically reloaded
- Backend changes trigger automatic restart
- LangGraph server supports hot-reload
-
Access the application:
- Web Interface: http://localhost:2026
- API Gateway: http://localhost:2026/api/*
- LangGraph: http://localhost:2026/api/langgraph/*
# Build the custom k3s image (with pre-cached sandbox image)
make docker-init
# Start Docker services (mode-aware, localhost:2026)
make docker-start
# Stop Docker development services
make docker-stop
# View Docker development logs
make docker-logs
# View Docker frontend logs
make docker-logs-frontend
# View Docker gateway logs
make docker-logs-gatewayIf make docker-init, make docker-start, or make docker-stop fails on Linux with an error like below, your current user likely does not have permission to access the Docker daemon socket:
unable to get image 'deer-flow-dev-langgraph': permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
Recommended fix: add your current user to the docker group so Docker commands work without sudo.
- Confirm the
dockergroup exists:getent group docker
- Add your current user to the
dockergroup:sudo usermod -aG docker $USER - Apply the new group membership. The most reliable option is to log out completely and then log back in. If you want to refresh the current shell session instead, run:
newgrp docker
- Verify Docker access:
docker ps
- Retry the DeerFlow command:
make docker-stop make docker-start
If docker ps still reports a permission error after usermod, fully log out and log back in before retrying.
Host Machine
↓
Docker Compose (deer-flow-dev)
├→ nginx (port 2026) ← Reverse proxy
├→ web (port 3000) ← Frontend with hot-reload
├→ api (port 8001) ← Gateway API with hot-reload
├→ langgraph (port 2024) ← LangGraph server with hot-reload
└→ provisioner (optional, port 8002) ← Started only in provisioner/K8s sandbox mode
Benefits of Docker Development:
- ✅ Consistent environment across different machines
- ✅ No need to install Node.js, Python, or nginx locally
- ✅ Isolated dependencies and services
- ✅ Easy cleanup and reset
- ✅ Hot-reload for all services
- ✅ Production-like environment
If you prefer to run services directly on your machine:
Check that you have all required tools installed:
make checkRequired tools:
- Node.js 22+
- pnpm
- uv (Python package manager)
- nginx
-
Configure the application (same as Docker setup above)
-
Install dependencies:
make install
-
Run development server (starts all services with nginx):
make dev
-
Access the application:
- Web Interface: http://localhost:2026
- All API requests are automatically proxied through nginx
If you need to start services individually:
-
Start backend services:
# Terminal 1: Start LangGraph Server (port 2024) cd backend make dev # Terminal 2: Start Gateway API (port 8001) cd backend make gateway # Terminal 3: Start Frontend (port 3000) cd frontend pnpm dev
-
Start nginx:
make nginx # or directly: nginx -c $(pwd)/docker/nginx/nginx.local.conf -g 'daemon off;' -
Access the application:
- Web Interface: http://localhost:2026
The nginx configuration provides:
- Unified entry point on port 2026
- Routes
/api/langgraph/*to LangGraph Server (2024) - Routes other
/api/*endpoints to Gateway API (8001) - Routes non-API requests to Frontend (3000)
- Centralized CORS handling
- SSE/streaming support for real-time agent responses
- Optimized timeouts for long-running operations
deer-flow/
├── config.example.yaml # Configuration template
├── extensions_config.example.json # MCP and Skills configuration template
├── Makefile # Build and development commands
├── scripts/
│ └── docker.sh # Docker management script
├── docker/
│ ├── docker-compose-dev.yaml # Docker Compose configuration
│ └── nginx/
│ ├── nginx.conf # Nginx config for Docker
│ └── nginx.local.conf # Nginx config for local dev
├── backend/ # Backend application
│ ├── src/
│ │ ├── gateway/ # Gateway API (port 8001)
│ │ ├── agents/ # LangGraph agents (port 2024)
│ │ ├── mcp/ # Model Context Protocol integration
│ │ ├── skills/ # Skills system
│ │ └── sandbox/ # Sandbox execution
│ ├── docs/ # Backend documentation
│ └── Makefile # Backend commands
├── frontend/ # Frontend application
│ └── Makefile # Frontend commands
└── skills/ # Agent skills
├── public/ # Public skills
└── custom/ # Custom skills
Browser
↓
Nginx (port 2026) ← Unified entry point
├→ Frontend (port 3000) ← / (non-API requests)
├→ Gateway API (port 8001) ← /api/models, /api/mcp, /api/skills, /api/threads/*/artifacts
└→ LangGraph Server (port 2024) ← /api/langgraph/* (agent interactions)
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes with hot-reload enabled
-
Test your changes thoroughly
-
Commit your changes:
git add . git commit -m "feat: description of your changes"
-
Push and create a Pull Request:
git push origin feature/your-feature-name
# Backend tests
cd backend
uv run pytest
# Frontend checks
cd frontend
pnpm checkEvery pull request runs the backend regression workflow at .github/workflows/backend-unit-tests.yml, including:
tests/test_provisioner_kubeconfig.pytests/test_docker_sandbox_mode_detection.py
- Backend (Python): We use
rufffor linting and formatting - Frontend (TypeScript): We use ESLint and Prettier
- Configuration Guide - Setup and configuration
- Architecture Overview - Technical architecture
- MCP Setup Guide - Model Context Protocol configuration
- Check existing Issues
- Read the Documentation
- Ask questions in Discussions
By contributing to DeerFlow, you agree that your contributions will be licensed under the MIT License.