Docker deployment Dify + RAGFlow avoidance guide

Written by
Caleb Hayes
Updated on:July-08th-2025
Recommendation

Master the practical skills of deploying Dify+RAGFlow in Docker to effectively avoid common problems.

Core content:
1. Diagnosis and solution strategies for port conflict problems
2. Identification and adjustment methods for dependency service conflicts
3. Optimization solutions for insufficient hardware resources and model integration configuration
4. Techniques for handling Docker environment problems
5. Methods for improving file parsing and retrieval effects

Yang Fangxian
Founder of 53AI/Most Valuable Expert of Tencent Cloud (TVP)

After installing dify and RAGFlow in Docker, you may encounter the following problems:


1. Port conflict problem

  1. Symptom : Dify and RAGFlow use the same ports (80 and 443) by default, causing a service to fail to start. Solution :
  • Modify the port mapping of RAGFlow, for example docker-compose.yml Medium Adjustment:
    ports:
      - "8000:80" # Container port 80 is mapped to host port 8000   
      - "4333:443" # Container port 443 is mapped to host port 4333  
  • Restart the service:docker-compose up -d.
  • Check firewall rules to make sure new ports (such as 8000, 4333) are open.

2. Dependency Service Conflict

  1. Phenomenon : Both rely on Redis, and conflicts will occur if the default configurations are the same. Solution :
  • Modify the Redis configuration of RAGFlow (in .env in the document):
    redis_port=7379 # Change the default port
    redis_password=custom password
  • Make sure Dify's Redis configuration is independent (eg use a different port or password).

3. Insufficient hardware resources

  1. Symptom : RAGFlow has high resource requirements (CPU ≥ 4 cores, memory ≥ 16GB, disk ≥ 50GB). When resources are insufficient, it fails to start or runs slowly. Solution :
  • Check your server configuration, upgrade your hardware, or adjust Docker resource allocation (set CPU/memory limits via Docker Desktop).
  • For Linux systems, kernel parameters need to be set:
    sudo sysctl -w vm.max_map_count=262144   # Temporary effect
    sudo vim /etc/sysctl.conf                # Permanent effect

4. Model Integration Configuration Issues

  1. Symptom : When integrating a local model (such as Ollama), the API is not authorized or the model cannot be loaded. Solution :
  • Create an API Key in RAGFlow and record the repository ID.
  • Dify .env Fill in the RAGFlow API address and Key in the file:
    API_ENDPOINT=http://<RAGFlow_IP>:9380/api/v1/dify
    API_KEY=your_ragflow_api_key
  • Disable Dify's Rerank model and give priority to RAGFlow's parsing results.

5. Docker environment issues

  1. Symptom (Windows specific):
  • WSL2 is not enabled : Docker Desktop cannot be started. Solution : Run PowerShell with administrator privileges:
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all
    wsl --set-default-version 2
  • Image pull failed : Network problems caused image download to time out. Solution : Use a domestic image source or a pre-packaged one-click installation package.

6. Document parsing and retrieval effect issues

  1. Phenomenon : Dify's native knowledge base has poor parsing effect on PDF scans and tables. Solution :
  • Upload files through RAGFlow and take advantage of its deep document parsing capabilities (supports OCR, layout recognition, etc.).
  • In Dify, associate RAGFlow's external knowledge base and adjust parameters such as  TopK (number of retrievals) and  similarity threshold .

Post-launch verification steps

  1. Access services :
  • Dify:http://<IP>:80
  • RAGFlow:http://<IP>:8000(If the port has been modified).
  • Log troubleshooting :
    docker logs -f ragflow-server   # View RAGFlow logs
    docker logs dify-app           # View Dify logs
  • Test the knowledge base : Create an application in Dify and associate it with the RAGFlow knowledge base to verify the accuracy of questions and answers.

  • Summary and recommendations

    • Recommended deployment scheme :
      • Deploy Dify and RAGFlow on the same host and communicate through the intranet IP to reduce latency.
      • Using RAGFlow docker-compose-gpu.yml Configure to accelerate processing if GPU is available.
    • Tips for avoiding pitfalls : Windows users need to first resolve the WSL2 and port conflicts; Linux users need to check kernel parameters and resource allocation.