Comprehensive configuration guide for RAGFlow including environment variables, LLM setup, document engine, and service configuration.
| File | Purpose |
|---|---|
docker/.env |
Fundamental environment settings |
docker/service_conf.yaml.template |
Back-end service configuration |
docker/docker-compose.yml |
Service orchestration |
# MySQL
MYSQL_HOST=mysql
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=your-secure-password
# Redis
REDIS_HOST=redis
REDIS_PORT=6379
# HTTP Server
SVR_HTTP_PORT=80
# RAGFlow Image
RAGFLOW_IMAGE=infiniflow/ragflow:v0.24.0
# Device (cpu or gpu)
DEVICE=cpu
# MinIO Object Storage
MINIO_HOST=minio
MINIO_PORT=9000
MINIO_USER=minioadmin
MINIO_PASSWORD=your-secure-password
# Choose: elasticsearch or infinity
DOC_ENGINE=elasticsearch
# Default LLM provider
user_default_llm: OpenAI
# LLM API Key
API_KEY: sk-your-api-key-here
# Model settings
model:
name: gpt-4o
max_tokens: 4096
temperature: 0.7
| Provider | Config Name |
|---|---|
| OpenAI | OpenAI |
| Anthropic | Anthropic |
| Google Gemini | Gemini |
| Azure OpenAI | AzureOpenAI |
| Ollama | Ollama |
| LocalAI | LocalAI |
| Mistral | Mistral |
| Groq | Groq |
embedding:
model: text-embedding-3-small
dimensions: 1536
Edit docker/docker-compose.yml:
services:
ragflow:
ports:
# Change from 80:80 to your desired port
- "8080:80"
Restart:
docker compose -f docker-compose.yml up -d
# Stop containers
docker compose -f docker-compose.yml down -v
# Edit .env
nano .env
# Change: DOC_ENGINE=infinity
# Restart
docker compose -f docker-compose.yml up -d
⚠️ Warning:
-vremoves all volumes and data!
# Edit .env
nano .env
# Add or uncomment:
DEVICE=gpu
# Restart
docker compose -f docker-compose.yml up -d
# Check NVIDIA GPU
nvidia-smi
# Check container GPU access
docker exec -it ragflow-container nvidia-smi
http://localhostEdit docker/service_conf.yaml.template:
llm:
provider: OpenAI
api_key: sk-your-api-key
base_url: https://api.openai.com/v1
model: gpt-4o
Configure external data sources:
data_sync:
confluence:
enabled: true
base_url: https://your-domain.atlassian.net
api_token: your-confluence-token
data_sync:
s3:
enabled: true
bucket: your-bucket
region: us-east-1
access_key: your-access-key
secret_key: your-secret-key
data_sync:
notion:
enabled: true
api_key: your-notion-api-key
data_sync:
google_drive:
enabled: true
credentials_file: /path/to/credentials.json
Since December 2025, RAGFlow supports AI agent memory:
agent:
memory:
enabled: true
max_turns: 20
persistence: true
mcp:
enabled: true
servers:
- name: filesystem
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/data"]
- name: database
command: npx
args: ["-y", "@modelcontextprotocol/server-postgres", "postgresql://..."]
# Stop containers
docker compose -f docker-compose.yml down
# Backup volumes
docker run --rm \
-v ragflow_mysql_data:/source \
-v $(pwd):/backup \
alpine tar czf mysql-backup.tar.gz -C /source .
docker run --rm \
-v ragflow_minio_data:/source \
-v $(pwd):/backup \
alpine tar czf minio-backup.tar.gz -C /source .
# Restore MySQL
docker run --rm \
-v ragflow_mysql_data:/target \
-v $(pwd):/backup \
alpine tar xzf mysql-backup.tar.gz -C /target
# Restore MinIO
docker run --rm \
-v ragflow_minio_data:/target \
-v $(pwd):/backup \
alpine tar xzf minio-backup.tar.gz -C /target
Any questions?
Feel free to contact us. Find all contact information on our contact page.