Skip to main content
Deploy DeerFlow using Docker for a consistent, isolated environment. Docker deployment is the recommended approach for both development and production.

Architecture

DeerFlow’s Docker deployment consists of four main services:

Prerequisites

  • Docker 20.10+ or Docker Desktop
  • Docker Compose v2.0+
  • 4GB RAM minimum (8GB recommended)
  • 10GB disk space

Quick Start

1. Clone and Configure

2. Configure Your Model

Edit config.yaml to add at least one LLM model:

3. Set API Keys

Edit .env file in the project root:

4. Initialize and Start

5. Access the Application

Open your browser to:

Docker Compose Services

Frontend Service

Key Features:
  • Next.js 14 with App Router
  • Hot reload for development
  • pnpm package manager
  • Node.js 22-alpine base image

Gateway Service

Provides:
  • Models API (/api/models)
  • MCP configuration (/api/mcp)
  • Skills management (/api/skills)
  • File uploads (/api/threads/{id}/uploads)
  • Artifact serving (/api/threads/{id}/artifacts)

LangGraph Service

Handles:
  • Agent runtime execution
  • Thread state management
  • SSE streaming responses
  • Checkpoint persistence
  • Tool execution

Nginx Service

Routes:
  • /api/langgraph/* → LangGraph server (2024)
  • /api/* → Gateway API (8001)
  • /* → Frontend (3000)

Volume Mounts

Development Volumes

For hot reload and development:

Cache Volumes

For faster builds:

Network Configuration

DeerFlow uses a custom bridge network:
Benefits:
  • Service discovery via DNS
  • Internal service communication
  • Isolation from other containers
  • Predictable IP addressing

Environment Variables

Required Variables

Optional Variables

Building Images

Backend Image

From backend/Dockerfile:
Build command:

Frontend Image

From frontend/Dockerfile:
Build command:

Management Commands

Start Services

Stop Services

View Logs

Restart Services

Production Optimizations

Multi-stage Build

For smaller production images:

Environment-specific Compose

Create docker-compose.prod.yaml:

Health Checks

Add health checks to services:

Troubleshooting

Services Not Starting

Check logs:
Verify configuration:

Port Conflicts

Check port usage:
Change ports in docker-compose.yaml:

Volume Permission Issues

Fix permissions:

Image Build Failures

Clear build cache:
Rebuild without cache:

Network Issues

Recreate network:

Next Steps

Kubernetes Deployment

Deploy DeerFlow on Kubernetes with pod-based sandboxes

Production Guide

Production deployment best practices and optimization

See Also