---
title: "Deploy RAGFlow GraphRAG"
description: "Knowledge graph extraction over your RAG datasets"
category: "AI/ML"
url: https://railway.com/deploy/deploy-ragflow-graphrag-knowledge-graph
---

# Deploy RAGFlow GraphRAG

Knowledge graph extraction over your RAG datasets

**[Deploy RAGFlow GraphRAG on Railway](https://railway.com/template/deploy-ragflow-graphrag-knowledge-graph)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-ragflow-graphrag-knowledge-graph/manifest.json

- **Creator:** onepush
- **Category:** AI/ML

## Template content

### MinIO

- **Image:** pgsty/silo:RELEASE.2026-08-06T00-00-00Z@sha256:29a498b24669cae1fed11c1a2fb2b3d73c68829a0a9c0b14e71b386671d38fac
- **Start command:** `/usr/bin/docker-entrypoint.sh silo server /data --address :9000 --console-address :9001`
- **Health check:** /minio/health/live

### MySQL https://devicons.railway.app/i/mysql.svg

- **Image:** mysql:8.4.11@sha256:24989179f58856db763f418010c1169fecc944e3ec1ea7e921572d83eb070f70
- **Start command:** `docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=1G --max-connections=1000 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-allowed-packet=1073741824`

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.10@sha256:47670742d7924adbcdb404d1288b6327815b23141969c0939b8e5d61f78c2634
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### ragflow

- **Image:** infiniflow/ragflow:v0.27.2@sha256:e6b3f1a185c0a70abb3a72e1092415df8c5c6a4fae0089545554f2936c4b27ab
- **Start command:** `/ragflow/entrypoint.sh --enable-adminserver --init-model-provider-tables`
- **Health check:** /api/v1/system/healthz
- **Public domain:** Yes

### Elasticsearch

- **Image:** elasticsearch:8.11.3@sha256:58a3a280935d830215802322e9a0373faaacdfd646477aa7e718939c2f29292a
- **Start command:** `/bin/bash -c "rm -rf /usr/share/elasticsearch/data/lost+found; chown -R 1000:0 /usr/share/elasticsearch/data && cd /usr/share/elasticsearch && exec setpriv --reuid=1000 --regid=0 --clear-groups env HOME=/usr/share/elasticsearch /bin/tini -- /usr/local/bin/docker-entrypoint.sh eswrapper"`

## Documentation

# Deploy and Host self hosted RAGFlow GraphRAG (Open-Source GraphRAG Engine) on Railway

This template runs RAGFlow v0.27.2 with Elasticsearch, MySQL, Redis and MinIO on Railway. It suits teams testing GraphRAG on a small corpus.

## About Hosting RAGFlow GraphRAG open-source software on Railway (self hosted RAGFlow GraphRAG template)

RAGFlow GraphRAG keeps documents, extracted entities and graph chunks in your own Railway project. Model keys go in under Model providers, so they stay with you.

Railway handles the tedium: private networking between the five services, generated passwords and secret key, volumes for the stateful ones, TLS on your domain, and a health check on /api/v1/system/healthz.

## Why Deploy RAGFlow GraphRAG, the Microsoft GraphRAG alternative on Railway (Railway Free Trial)

Microsoft GraphRAG means wiring an indexing pipeline yourself. Here graph building is a dataset setting next to parsing and chat. Try it on the $5 trial with a tiny dataset.

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 GraphRAG 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 GraphRAG self hosting

Railway runs the same five services as the upstream compose file, so the choice comes down to who tunes Elasticsearch.

| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | Five services pre-wired, secrets generated | Droplets plus your own Elasticsearch and kernel tuning |
| AWS | One project, private networking and volumes | EC2, ECS, IAM, security groups, Elasticsearch tuning |
| Hetzner | One click, RAM scaled from the dashboard | Cheap RAM, but you patch the host and set vm.max_map_count |

The trade is the same everywhere: you pay for RAM, and Elasticsearch eats most of it.

## Common Use Cases for hosted RAGFlow GraphRAG

- **Multi-hop questions over contracts:** Ask which vendor owns the indemnity clause in the renewal signed after the merger, and retrieval walks the graph from vendor to agreement to amendment instead of guessing from one chunk.
- **People and organization maps from reports:** With entity types set to organization, person, event and category, quarterly reports become a map of who signed what, who reports to whom, and which events touched which account.
- **Deduplicating entities across documents:** Entity resolution merges variants like "2025" and "the year of 2025" so the same customer is not counted five times across five files.
- **Community summaries of a research corpus:** Community reports give you LLM summaries of entity clusters, which is the fastest way to see the shape of a few hundred papers before you ask anything specific.
- **Agent retrieval with graph context:** In agent workflows the Retrieval component has the same Use knowledge graph toggle, so a tool call can pull related chunks rather than only keyword matches.

## Dependencies for RAGFlow GraphRAG Docker hosted on Railway

This template runs infiniflow/ragflow:v0.27.2, pinned by digest, with the four services it needs: Elasticsearch 8.11.3 as the doc engine (graph chunks land there), MinIO via pgsty/silo, MySQL 8.4.11 and Redis 8.2.10.

### Deployment Dependencies for Managed RAGFlow GraphRAG Service (GraphRAG Engine)

- **ragflow:** port 80 public, API 9380, admin server 9381, volume /ragflow/logs, health /api/v1/system/healthz, 900s timeout.
- **Elasticsearch:** 1 GB heap, volume /usr/share/elasticsearch/data. **MinIO (pgsty/silo):** volume /data. **MySQL:** rag_flow, volume /var/lib/mysql. **Redis:** volume /data.
- **Secrets:** RAGFLOW_SECRET_KEY, ADMIN_DEFAULT_PASSWORD, ELASTIC_PASSWORD, MINIO_ROOT_PASSWORD, MYSQL_ROOT_PASSWORD, REDIS_PASSWORD. Fixed: DOC_ENGINE=elasticsearch, DEVICE=cpu, TZ=UTC.

### Implementation Details for RAGFlow GraphRAG (Using RAGFlow official docker image)

Start: `/ragflow/entrypoint.sh --enable-adminserver --init-model-provider-tables`. Add LLM keys in the UI, not env vars. RAGFlow and Elasticsearch share project RAM, so test small.

## How does RAGFlow GraphRAG compare against other GraphRAG tools

### RAGFlow vs Microsoft GraphRAG (GraphRAG Alternative)

- **Same prompts, different shell:** the General method feeds Microsoft GraphRAG prompts, but the graph lands in your dataset next to the chunks you already chat with.
- **Light is the default:** start there, because General costs noticeably more tokens and memory.
- **Where GraphRAG wins:** corpus-scale community reports and a standalone Python pipeline you can script, cache and rerun outside any UI.

### RAGFlow vs LightRAG (LightRAG Alternative)

- **Shared DNA:** Light is the default method and reuses LightRAG prompts, with fewer tokens, less memory and less CPU than General.
- **Fewer knobs:** LightRAG as a library lets you pick graph stores and retrieval strategy; RAGFlow gives you entity types, method, resolution and reports.
- **Where LightRAG wins:** pluggable backends like Neo4j and no dependency on the Elasticsearch doc engine.

### RAGFlow vs Neo4j GraphRAG (Neo4j GraphRAG Alternative)

- **Not a property graph:** RAGFlow stores graph chunks and community reports in the doc engine (Elasticsearch on this template), so there are no Cypher queries.
- **Consumption is a toggle:** you switch on Use knowledge graph in a chat assistant or the Retrieval agent component rather than writing traversal queries.
- **Where Neo4j wins:** real graph analytics, path queries and edges you can inspect, correct and audit one at a time.

### RAGFlow vs Dify (Dify Alternative)

- **Extraction is built in:** Dify gives you knowledge bases and chunk retrieval; graph building is a RAGFlow dataset feature, not something you assemble.
- **Both self host:** model providers, agents and APIs exist in each; Dify is the better fit when you mostly want workflow building.
- **Where Dify wins:** workflow building comes first, and no graph build to pay for when multi-hop is not the problem.
- **Watch the bill:** both consume chat model tokens, but only RAGFlow also spends on graph builds. Test on a small dataset first.

## How to use RAGFlow GraphRAG (the OSS RAG engine)?

1. Open your Railway domain and register the first account, then set REGISTER_ENABLED to 0.
2. Under Model providers add a chat model and an embedding model.
3. Create a dataset, upload a few files, and parse them with a chunking template.
4. In the dataset Configuration page set Entity types (defaults: organization, person, event, category) and Method, Light or General.
5. On the Files page click Generate in the top right, then Knowledge graph.
6. Wait until the Knowledge graph field shows a timestamp instead of Not generated.
7. In a chat assistant switch on Use knowledge graph and ask a multi-hop question.

## How to self host RAGFlow GraphRAG on other VPS Services (RAGFlow self hosting guide)

The same v0.27.2 stack runs on any VPS with 4 cores, 16 GB RAM and 50 GB disk.

### Clone the Repository

```
git clone https://github.com/infiniflow/ragflow
cd ragflow/docker
```

### Install Dependencies

Install Docker 24+ and Compose, then raise the Elasticsearch map count.

```
sudo sysctl -w vm.max_map_count=262144
```

### Configure Environment Variables

Edit docker/.env in place: keep DOC_ENGINE=elasticsearch and DEVICE=cpu, and replace every default password.

```
grep -nE 'DOC_ENGINE|DEVICE|PASSWORD' .env
```

### Start the RAGFlow GraphRAG Application

```
docker compose -f docker-compose.yml up -d
```

First boot pulls several GB of images and DeepDoc models. Railway runs all five services, secrets and health checks for you.

## Official Pricing of RAGFlow GraphRAG (RAGFlow pricing)

RAGFlow is Apache-2.0, so GraphRAG costs nothing to license: you pay for infrastructure, and for the LLM tokens each graph build burns.

## RAGFlow GraphRAG cloud vs self hosted comparison (Pricing, features, costs, and more)

Self hosting splits into two bills: the Railway project, which is predictable, and the LLM that builds the graph, which is not.

### Monthly cost of self hosting RAGFlow GraphRAG on Railway

Expect about $40-80/mo on Railway because Elasticsearch, MySQL, and the RAGFlow container with DeepDoc models need several GB of RAM, and large datasets push past that.

### System Requirements for Hosting RAGFlow GraphRAG on a VPS

Upstream asks for 4 CPU cores, 16 GB RAM, 50 GB disk and Docker 24+, plus vm.max_map_count 262144 for Elasticsearch.

## Frequently Asked Questions (FAQs)

### How much does graph extraction cost?

It is the most token-hungry step in RAGFlow. Test on a small dataset with a cheap chat model first; the docs warn it needs significant memory, compute and tokens.

### Should I pick Light or General?

Light is the default and uses LightRAG-style prompts with fewer tokens, less memory and CPU. General uses Microsoft GraphRAG prompts and produces richer entities and relationships at a higher bill.

### Does the graph update when new files are parsed?

Yes. RAGFlow keeps one graph per dataset across all its files. When a newly uploaded file is parsed, the graph updates automatically.

### What do entity resolution and community reports do?

Resolution merges duplicate entities; reports summarize entity clusters with the LLM. Both are off by default and cost extra tokens.

### Where is the graph stored?

As extra chunks in the doc engine, which is Elasticsearch on this template, sitting alongside your dataset. Community reports are stored there too.

### Is GraphRAG the same as RAPTOR?

No. RAPTOR is a separate dataset option that recursively summarizes chunks. The knowledge graph is its own run from the Files page, with its own token bill.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Möbius v0.1 Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.

Open this page in a browser: https://railway.com/deploy/deploy-ragflow-graphrag-knowledge-graph
