Are you looking for a fast way to transform scattered documents into a powerful, AI-driven Q&A system? RAGFlow, an open-source Retrieval-Augmented Generation (RAG) engine, lets you build citation-backed search and chat tools from your own data—even if you’re new to AI.
In this hands-on guide, you’ll learn how to set up RAGFlow on Linux or Windows, connect your favorite LLMs, create assistants, and even build a web search agent. Whether you’re an API developer, backend engineer, or technical lead, this walkthrough will help you turn complex document sets into searchable knowledge bases.
💡 Want an API testing platform that generates beautiful API Documentation and boosts developer team productivity? Apidog delivers all-in-one collaboration and replaces Postman at a much more affordable price!
What is RAGFlow? Build Intelligent Q&A from Your Documents
RAGFlow is an open-source RAG engine that leverages deep document parsing and large language models (LLMs) to answer questions using your own files. Unlike basic AI chat tools, RAGFlow grounds every response in cited, verifiable sources—reducing hallucinations and boosting trust.
Key Features:
- Advanced Document Understanding: Extracts tables, images, and structured data from PDFs, Word docs, CSVs, and more.
- Cited, Reliable Answers: Every output is backed by traceable references to your source documents.
- Multi-Format Support: Handles PDFs, DOCX, images, and spreadsheets.
- Open Source & Scalable: 55K+ GitHub stars; suitable for enterprise and solo projects.
Whether you manage technical docs, research papers, or API references, RAGFlow makes your knowledge base instantly searchable.
Why Choose RAGFlow for Developer Teams?
For API and backend engineers, RAGFlow streamlines document-based Q&A, reducing hours spent searching manuals, specs, or compliance docs.
Benefits for Technical Teams:
- Accuracy: Answers are always grounded in your actual documents.
- Flexibility: Works with both cloud and local data, from internal wikis to external reports.
- User-Friendly: No deep AI knowledge needed—easy UI, but customizable for advanced users.
- Scalable: Handles anything from a single product spec to enterprise-scale documentation.
I tested RAGFlow with a stack of engineering PDFs. It indexed tables, diagrams, and code snippets—making technical search faster than ever.
Step-by-Step: Setting Up RAGFlow on Linux & Windows
Follow these practical steps to get RAGFlow running on your machine. No prior AI deployment experience required.
1. Prerequisites & System Requirements
Before you start, ensure your environment meets the following:
- CPU: 4+ cores (x86 recommended)
- RAM: 16GB or more
- Disk: 50GB free
- Docker: v24.0.0+
- Docker Compose: v2.26.1+
- (Optional) NVIDIA GPU: For faster model inference
- (Optional) gVisor: For secure, sandboxed code execution
Check Docker versions:
docker --version
docker compose version
2. System Configuration
On Linux (Ubuntu)
Increase memory mapping for Elasticsearch/Infinity:
sudo sysctl -w vm.max_map_count=262144
echo "vm.max_map_count=262144" | sudo tee -a /etc/sysctl.conf
On Windows (Using WSL2)
Enable WSL2 and install Ubuntu:
wsl --install
Set memory mapping in your WSL terminal:
sudo sysctl -w vm.max_map_count=262144
Persist the setting in %USERPROFILE%\.wslconfig:
[wsl2]
kernelCommandLine = "sysctl.vm.max_map_count=262144"
Restart your PC.
3. Install Docker & Docker Compose
Linux:
sudo apt update
sudo apt install -y docker.io docker-compose
sudo systemctl enable --now docker
docker --version
docker-compose --version

Windows:
- Install Docker Desktop and enable WSL2 integration.
- Verify Docker in PowerShell:
docker --version
docker-compose --version
4. Clone the RAGFlow Repository
git clone https://github.com/infiniflow/ragflow.git
cd ragflow
git checkout -f v0.19.0
5. Configure Docker Environment
Navigate to the Docker folder:
cd docker
nano .env
Set the following environment variables:
RAGFLOW_IMAGE=infiniflow/ragflow:v0.19.0-slim
SVR_HTTP_PORT=80
MYSQL_PASSWORD=your_secure_password
MINIO_PASSWORD=your_secure_password
Choose v0.19.0-slim (downloads models on demand, smaller footprint) or v0.19.0 (includes pre-installed models).
If HuggingFace is slow, add:
HF_ENDPOINT=https://hf-mirror.com
6. Launch the RAGFlow Server
Start the main server:
docker compose -f docker-compose.yml up -d
For GPU acceleration:
docker compose -f docker-compose-gpu.yml up -d
Check running containers:
docker ps
7. Resolving Port Conflicts
If port 80 is in use:
sudo lsof -i :80
sudo service apache2 stop # Stop conflicting service
Or change SVR_HTTP_PORT in .env to another port (e.g., 8080) and restart Docker Compose.
8. Verify and Access the RAGFlow UI
Monitor logs:
docker logs -f ragflow-server
When ready, access the web UI:
http://localhost
Log in with default credentials (see ragflow.io/docs for details).
9. Connect Model Providers (OpenAI, Anthropic, Ollama)
- Click your profile (top right) > Model Providers.
- Add your API key and base URL.
- OpenAI:
https://api.openai.com/v1 - Anthropic:
https://api.anthropic.com/v1 - Ollama:
http://host.docker.internal:11434(for local LLMs)
- OpenAI:
- Save to enable your chosen models.

Using OpenAI or Anthropic expands your model options—ideal for advanced document chat and API reference search.
10. Build a Knowledge Base from Your Files
-
Go to
Knowledge Base>Create Knowledge Base -
Enter a name (e.g., "API Reference Library")

-
Add an optional image, set access permissions, and pick language.
-
Select an embedding model (e.g., OpenAI’s
text-embedding-3-small) -
For most cases, default chunk and question settings work well.
-
Click
+ Add File>Local Filesto upload your docs (PDF, DOCX, etc.). -
Click
Playto parse. Wait for a "SUCCESS" status.


RAGFlow accurately parses complex tables, diagrams, and code snippets.
11. Create a Chat Assistant for Your Data
- Go to
Chat>Create an Assistant - Name your assistant (e.g., "API Support Bot")
- (Optional) Add a description, avatar, or custom opener
- Attach your knowledge base(s)
- Customize prompt settings or use defaults
- Choose a model provider (OpenAI, Anthropic, Ollama, etc.)

Test your assistant:
Ask "What is the rate limit for our API?" or "Summarize the authentication section."
RAGFlow returns answers with direct citations—perfect for API and engineering teams.
12. Build a Custom Web Search Agent
-
Go to
Agent>Create Agent -
Select "Websearch Agent", give it a name (e.g., "API Trend Finder")
-
Use the node builder to configure steps:
- Assign a model to each node ("Refine Question", "Get Keywords", "LLM")

- Assign a model to each node ("Refine Question", "Get Keywords", "LLM")
-
Click
Runand ask, "What are the latest REST API best practices?" -
Instantly get web-based responses—no coding required.
13. (Optional) Run Ollama for Local LLMs
- Install NVIDIA Container Toolkit for GPU support (see NVIDIA docs)
- Run Ollama:
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
docker exec -it ollama ollama pull llama3.2
docker exec -it ollama ollama pull bge-m3
- In RAGFlow, add Ollama as a provider (
http://host.docker.internal:11434), then select local models for privacy-first workflows.
Troubleshooting Common RAGFlow Issues
- Port Conflict:
Linux:lsof -i :80
Windows:netstat -ano | findstr :80 - Parsing Stuck:
Check Elasticsearch logs:docker logs ragflow-elasticsearch - HuggingFace Model Error:
AddHF_ENDPOINT=https://hf-mirror.comto your.env - Model Provider Error:
Double-check API keys and endpoints in the UI - WSL2 Problems:
Ensure Docker Desktop’s WSL integration is enabled
Need more help? Visit ragflow.io/docs or GitHub.
Advanced Tips: Customizing and Extending RAGFlow
- Fine-tune Chunking: Adjust chunk size or enable auto-keyword extraction for better search precision.
- Integrate with APIs: Use RAGFlow’s HTTP/Python APIs to plug Q&A into your existing tools and dashboards.
- Build Complex Agents: Create customer support bots, text-to-SQL agents, or multi-language search flows with the node builder.
- Multi-Language Support: Enable cross-language retrieval for global teams.
For API-focused teams, integrating RAGFlow with your internal developer portal or API documentation site can supercharge knowledge access. Apidog, for example, helps you generate beautiful API Documentation and manage your workflows—all in one place.
Conclusion: Empower Your Team with RAGFlow
RAGFlow bridges the gap between static documents and dynamic, AI-powered Q&A—making complex knowledge instantly accessible. Its combination of deep document parsing, reliable citations, and visual agent builder (similar to n8n) outpaces most RAG frameworks. While Docker setup takes some initial effort, RAGFlow’s UI and support community make it achievable for any technical team.
Ready to power up your documentation, search, or support workflows? Try RAGFlow—and don’t forget to optimize your API lifecycle with tools like Apidog for seamless documentation and collaboration.
💡 Want an all-in-one API platform that delivers clear documentation and maximum productivity? Switch to Apidog and replace Postman at a better price!



