
Deploy RAGFlow PDF Parsing
Layout-aware PDF, table and scan parsing for RAG
MySQL
Just deployed
/var/lib/mysql
Elasticsearch
Just deployed
/usr/share/elasticsearch/data
ragflow
Just deployed
/ragflow/logs
Just deployed
/data
Redis
Just deployed
/data
Deploy and Host self hosted RAGFlow PDF Parsing (Open-Source Layout-Aware PDF Parsing for RAG) on Railway
This template deploys RAGFlow, an Apache-2.0 RAG engine whose DeepDoc parser reads scanned contracts, multi-column manuals, and papers with tables.
About Hosting RAGFlow PDF Parsing open-source software on Railway (self hosted RAGFlow PDF parsing with DeepDoc template)
Your PDFs, parsed chunks, embeddings, and uploaded files all live in services you control on your own Railway project, so nothing leaves your account except the calls you make to your chosen LLM provider.
Why Deploy RAGFlow PDF Parsing, the LlamaParse alternative on Railway (Railway Free Trial)
LlamaParse bills per page of credits, so re-parsing a 300-page manual while you tune chunking adds up. The trade-off is that you run the stack yourself.
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying RAGFlow PDF Parsing on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Railway vs Other Hosting Providers and VPS for RAGFlow PDF Parsing self hosting
Railway runs the five RAGFlow services as one project with deploy, env wiring and a public domain handled for you.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | One click deploy of ragflow, Elasticsearch, MySQL, Redis and MinIO with generated secrets. | A Droplet you size, where you set vm.max_map_count and run Docker Compose yourself. |
| AWS | No VPC or IAM setup needed for a first deploy. | Control over instance types and EBS volumes, with more networking to configure. |
| Hetzner | A hosted project with per-service memory visible in one dashboard. | Cheap RAM per euro, but you handle the full stack and its upkeep. |
Pick Railway for a fast start and a VPS when you need the lowest cost per gigabyte.
Common Use Cases for hosted RAGFlow PDF Parsing
- Scanned contracts with OCR: Legal and procurement teams upload image-only scans, and DeepDoc runs OCR and layout recognition so clauses, signature blocks, and schedules come out as readable chunks. Expect slow parsing on this template since it runs DEVICE=cpu.
- Research papers with tables and figures: The Paper chunk method groups text by section and keeps tables as their own chunks, so a question about a results table retrieves the table rather than a broken row.
- Multi-column manuals: The Manual method follows the reading order across columns and headers, which keeps procedure steps in sequence instead of interleaving two columns.
- Financial reports with tables: The Table method treats each row as a unit with its column headers, so figures like revenue by quarter stay tied to their labels.
- Slide decks exported to PDF: The Presentation method chunks per slide, which suits decks where each page is a self-contained idea and keeps speaker-note text from bleeding into unrelated answers.
Dependencies for RAGFlow PDF Parsing Docker hosted on Railway
This template runs the RAGFlow PDF parsing stack as five services on Railway's private network.
Deployment Dependencies for Managed RAGFlow PDF Parsing Service (RAG Engine)
- ragflow: the official RAGFlow image, serving the web UI on port 80, the API on 9380, and the admin server on 9381.
- Elasticsearch 8.11.3: the document engine for chunk storage and search, data in /usr/share/elasticsearch/data.
- MySQL 8.4.11: the relational database (rag_flow), data in /var/lib/mysql.
- Redis 8.2.10: the task queue, locks, and caches, data in /data.
- MinIO (pgsty/silo): S3-compatible storage for uploaded PDFs, data in /data.
Implementation Details for RAGFlow PDF Parsing (Using RAGFlow official docker image)
The ragflow service sets DOC_ENGINE=elasticsearch, DEVICE=cpu, DB_TYPE=mysql, USE_DOCLING=false, and TZ=UTC.
How does RAGFlow PDF Parsing compare against other ways to parse PDFs for RAG
RAGFlow vs LlamaParse (LlamaIndex Hosted Parsing Alternative)
- Where RAGFlow wins: It runs on your own infrastructure, so scanned contracts stay on your network with no per-page credit meter.
- Chunking control: Templates such as Manual, Paper or Table let you inspect each chunk beside the original page before retrieval.
- Where LlamaParse wins: It is a hosted API with almost no setup, so a team that only wants markdown from PDFs starts faster.
RAGFlow vs Unstructured (Open-Source Document Partitioning Alternative)
- Built-in RAG pipeline: RAGFlow bundles parsing, chunking, hybrid search and grounded chat, while Unstructured mainly handles the parsing step.
- Layout handling: DeepDoc's table structure and layout recognition are central to RAGFlow's PDF path, which helps with multi-column manuals.
- Where Unstructured wins: It is a lighter Python library that fits batch jobs and existing pipelines better than a full web service.
RAGFlow vs Docling (IBM Open-Source Document Converter Alternative)
- Scope: Docling converts PDFs into structured documents, while RAGFlow also chunks, indexes and answers questions over them.
- Where Docling wins: It is MIT licensed and small, which suits teams that only need conversion output.
- Speed on this template: USE_DOCLING=false and DEVICE=cpu mean DeepDoc OCR on long scans is slow here, while Naive parsing is much faster for born-digital PDFs.
RAGFlow vs Azure Document Intelligence (Microsoft Cloud OCR and Layout Alternative)
- Where Azure wins: It is a managed cloud service with strong OCR and form extraction, backed by Microsoft's support and SLA.
- Data location: RAGFlow keeps uploads in your own MinIO and Elasticsearch, which matters for regulated documents that cannot go to a third-party cloud.
- Cost shape: Azure bills per page, so cost grows with volume, while RAGFlow costs the server you run plus CPU time on large scans.
How to use RAGFlow PDF Parsing (the OSS RAG engine)?
- Register, then add an LLM and an embedding provider under Model providers.
- Create a dataset and open its configuration page.
- Pick a chunk method that fits your PDFs, such as Manual for manuals, Paper for research papers, or General as a default.
- Choose the PDF parser: DeepDoc for scans and tables, Naive for clean digital PDFs, which is much faster on this CPU template.
- Set the chunk token size and delimiters, upload a PDF, and click Parse.
- Open the file's chunks to inspect and fix any broken tables, then run a retrieval test before building a chat.
curl -X POST "https://your-domain/api/v1/datasets" \
-H "Authorization: Bearer YOUR_RAGFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "contracts", "embedding_model": "your-embedding-model", "chunk_method": "naive"}'
Keep the parser choice in mind, because a wrong parser is the most common reason chunks come out garbled.
How to self host RAGFlow PDF Parsing on other VPS Services (RAGFlow self hosting guide)
Clone the Repository
Clone the upstream repo and move into the docker directory, where the compose file lives.
git clone https://github.com/infiniflow/ragflow.git
cd ragflow/docker
Install Dependencies
Install Docker 24 or newer with the Compose plugin. Plan for at least 4 CPU cores, 16 GB of RAM, and 50 GB of disk.
sudo sysctl -w vm.max_map_count=262144
Configure Environment Variables
Copy the example env file and set the secrets. Add model API keys in the UI under Model providers, not in this file.
cp .env.example .env
# set RAGFLOW_SECRET_KEY, ELASTIC_PASSWORD, MYSQL_ROOT_PASSWORD, REDIS_PASSWORD
# set DEVICE=cpu and USE_DOCLING=false
Start the RAGFlow PDF Parsing Application
Start the stack detached, then confirm the health endpoint returns OK before you open the UI.
docker compose -f docker-compose.yml up -d
curl -s http://your-domain/api/v1/system/healthz
On Railway, the platform runs the five services, volumes, domains, and restarts for you.
Official Pricing of RAGFlow PDF Parsing (RAGFlow pricing)
RAGFlow is open source under Apache-2.0, so there is no license fee to self host it.
RAGFlow PDF Parsing cloud vs self hosted comparison (Pricing, features, costs, and more)
Self hosting RAGFlow PDF Parsing trades a managed parsing API for control over chunk methods, parser choice, and where your documents live.
Monthly cost of self hosting RAGFlow PDF Parsing on Railway
Railway usage for this stack typically runs around $40-80 per month. Railway's $5 trial lets you test the deploy first.
System Requirements for Hosting RAGFlow PDF Parsing on a VPS
Upstream RAGFlow lists 4 CPU cores, 16 GB RAM, 50 GB disk, and Docker 24 or newer as minimums.
Frequently Asked Questions (FAQs)
Why is PDF parsing so slow on this Railway template?
This template runs DEVICE=cpu with USE_DOCLING=false, so DeepDoc's OCR and layout models run on CPU.
When should I pick DeepDoc instead of Naive?
Use DeepDoc for scanned contracts, pages with tables, and multi-column layouts where the text order matters.
How do tables become chunks?
With DeepDoc's table structure recognition, a table is detected and kept as a unit, and the Table chunk method turns each row into a chunk that keeps its column headers.
Can I use a vision model to parse PDFs?
Yes. It is slower and costs LLM calls, so reserve it for pages that DeepDoc handles poorly.
Do I need to re-parse after changing the chunk method?
Yes.
What do page ranges do?
Page ranges limit parsing to the pages you specify, which saves time and LLM calls on large PDFs when only a section matters.
Template Content
MySQL
mysql:8.4.11Elasticsearch
elasticsearch:8.11.3ragflow
infiniflow/ragflow:v0.27.2Redis
redis:8.2.10
