Back to articles
Technology Insight

Deploying RAGFlow on Docker VPS: Building an Enterprise-Grade RAG Platform with Layout-Aware Deep Document Parsing

May 30, 2026

Introduction: The Enterprise RAG Dilemma

In the era of corporate artificial intelligence, Retrieval-Augmented Generation (RAG) has emerged as the standard architecture for grounding Large Language Models (LLMs) in proprietary business data. However, many enterprise RAG initiatives hit a formidable roadblock during implementation: the challenge of unstructured data pipeline quality.

Standard RAG frameworks often rely on naive text-splitting mechanisms that slice documents based on arbitrary character counts or simple line breaks. When applied to complex corporate documents—such as multi-column financial reports, technical manuals with embedded tables, or legal contracts with intricate layouts—this naive approach fails catastrophically. Table structures are destroyed, headers are separated from their context, and the resulting embeddings become fragmented. This leads to the classic machine learning dilemma: garbage in, garbage out.

RAGFlow solves this fundamental issue. It is an open-source, enterprise-grade RAG engine based on deep document understanding. By utilizing sophisticated vision-based AI models, RAGFlow extracts and segregates data based on its graphical layout structure rather than just text strings. In this comprehensive guide, we will explore the core architecture of RAGFlow and walk through a step-by-step technical deployment on a virtual private server (VPS) using Docker.

Why RAGFlow? The Power of Layout-Aware Parsing

Before diving into the technical installation, it is crucial to understand what differentiates RAGFlow from traditional frameworks like LangChain or LlamaIndex templates:

  • Vision-Based Deep Document Understanding: RAGFlow employs advanced vision models to identify document components such as titles, paragraphs, charts, headers, footers, and complex multi-row/multi-column tables.
  • Template-Based Chunking: Instead of generic slicing, it provides specialized chunking templates tailored for diverse document types (e.g., Q&A pairs, book chapters, resumes, or financial spreadsheets).
  • Verifiable Citations: It features high-quality, fine-grained citations, allowing enterprise users to click on an LLM answer and view the exact bounding box on the original PDF or document layout where the source data resides.
  • Enterprise-Grade Hybrid Search: It natively integrates full-text keyword search with dense vector embeddings, optimized with re-ranking mechanisms to guarantee maximum retrieval precision.
Key Takeaway: RAGFlow treats document ingestion as a computer vision task combined with natural language processing, ensuring that structural context is preserved before the data ever reaches the vector database.

System Requirements and VPS Preparation

To run RAGFlow efficiently with its embedded deep learning parsing models, your VPS must meet specific minimum hardware requirements. While production workloads handling massive concurrent queries benefit significantly from NVIDIA GPUs, a CPU-only deployment is highly viable for development, testing, and moderate enterprise usage.

Minimum Hardware Recommendations (CPU-Only Mode)

  • CPU: 4 vCPUs (Intel Xeon or AMD EPYC modern architectures preferred)
  • RAM: 16 GB of RAM minimum (The deep learning models for layout parsing require substantial memory footprint during initialization)
  • Storage: 100 GB NVMe SSD (To accommodate Docker images, index indices, and uploaded document stores)
  • OS: Ubuntu 22.04 LTS or Ubuntu 24.04 LTS

Prerequisites Installation

Connect to your VPS via SSH and ensure your system repositories are up to date, followed by installing the latest versions of Docker and Docker Compose.

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl git apt-transport-https ca-certificates gnupg lsb-release

Install Docker Engine and Docker Compose using the official Docker convenience script:

curl -fsSL [https://get.docker.com](https://get.docker.com) -o get-docker.sh
sudo sh get-docker.sh
sudo apt-get install docker-compose-plugin -y

Verify the installation to confirm both daemons are running successfully:

docker --version
docker compose version

Step-by-Step RAGFlow Deployment via Docker Compose

RAGFlow utilizes a robust microservices architecture consisting of a frontend UI, backend API server, task executors, and essential core dependencies like Elasticsearch (for keyword and vector hybrid search), Redis (for caching), and MinIO (for object storage). Managing these components is streamlined using Docker Compose.

Step 1: Cloning the Repository

First, clone the official RAGFlow repository from GitHub and navigate to the deployment directory:

git clone [https://github.com/infiniflow/ragflow.git](https://github.com/infiniflow/ragflow.git)
cd ragflow/docker

Step 2: Configuring Environment Variables

RAGFlow manages its environment states via an .env file. Copy the provided template to create your production configuration:

cp env.example .env

Open the .env file using a text editor like Nano to adjust configurations if necessary:

nano .env

Within this file, you can modify default database passwords, specify host ports, and control the resource allocation. For instance, if you are running on a CPU-only VPS, ensure that any GPU-specific tags or profiles are left disabled or set to default values. Pay special attention to the STACK_VERSION variable, which ensures you pull the correct, stable version tag of the RAGFlow core images.

Step 3: Adjusting Virtual Memory for Elasticsearch

Because RAGFlow relies heavily on Elasticsearch for its hybrid search capabilities, you must increase the virtual memory allocation limit on the host VPS system. Failure to do this will cause the Elasticsearch container to crash on startup.

sudo sysctl -w vm.max_map_count=262144

To make this change permanent across system reboots, append the configuration line to the system configuration file:

echo "vm.max_map_count=262144" | sudo tee -a /etc/sysctl.conf

Step 4: Launching the Containers

With configurations finalized, execute the Docker Compose command to pull the required images and launch the infrastructure in detached mode:

docker compose up -d

The initial execution will take several minutes as Docker downloads multiple large-scale images, including the layout recognition models and database layers. Once the process completes, check the status of the containers:

docker compose ps

Ensure that all core services—ragflow-server, ragflow-web, elasticsearch, minio, and redis—show an 'Up' or 'Healthy' status.

Configuring the RAGFlow Enterprise Interface

Once the containers are operational, the RAGFlow web interface is accessible via your VPS IP address on the default HTTP port (typically port 80 or 8000 depending on your .env settings).

Accessing the Platform

Open a web browser and navigate to http://your-vps-ip/. You will be greeted by the RAGFlow initialization and login screen. Follow these essential configuration steps:

  1. Account Creation: Register your initial administrator account. This local authentication ensures your deployment remains isolated and secure.
  2. Integrating LLM Providers: Navigate to the 'Model Providers' tab within the settings menu. RAGFlow does not host LLMs internally by default; instead, it orchestrates external models. You can seamlessly add API keys for commercial providers such as OpenAI, Anthropic, or Cohere, or connect to self-hosted LLM instances powered by Ollama or vLLM running elsewhere in your infrastructure.
  3. Selecting Embedding Models: For layout-aware document retrieval to function, configure both a Chat Model and an Embedding/Reranking Model pair. Ensure your API keys have sufficient permissions to invoke embedding generation endpoints.

Optimizing Layout-Aware Chunking for Business Documents

The true power of RAGFlow shines when building your first knowledge base dataset. When uploading complex corporate documents, the system prompts you to choose an explicit Parser Configuration template:

  • General Template: Ideal for standard text-heavy documents, articles, and simple prose layouts.
  • Table Template: Tailored for financial sheets, inventory lists, and Excel files, ensuring rows and columns map to logical relational nodes.
  • Manual Template: Optimized for technical manuals or product documentation containing dense instructional steps alongside illustrative diagrams.
  • Paper Template: Specifically calibrated to parse double-column academic and corporate research whitepapers, ignoring unrelated running headers and footers.

Once a document is uploaded, RAGFlow initiates its background vision-processing workers. You can actively monitor the extraction process. Through the built-in UI visualizer, you can inspect how the deep learning models partitioned your document—viewing explicit colored bounding boxes around recognized tables, image captions, and text hierarchies. This granular control ensures absolute confidence in the structural integrity of your vector storage database.

Conclusion

Deploying RAGFlow on a Docker VPS equips modern businesses with an institutional knowledge framework capable of handling highly complex document structures that stymie traditional RAG architectures. By shifting from arbitrary character slicing to a layout-aware, vision-based parsing model, RAGFlow ensures the contextual accuracy required for enterprise-ready generative AI systems. Following this deployment guide establishes a private, scalable, and highly accurate retrieval foundation tailored to meet rigorous corporate standards.

Deploying RAGFlow on Docker VPS: Building an Enterprise-Grade RAG Platform with Layout-Aware Deep Document Parsing | DPTCloud