---
title: "Deploy RAGFlow Agent"
description: "Build agentic RAG flows on the RAGFlow canvas"
category: "AI/ML"
url: https://railway.com/deploy/deploy-ragflow-agent-workflows
---

# Deploy RAGFlow Agent

Build agentic RAG flows on the RAGFlow canvas

**[Deploy RAGFlow Agent on Railway](https://railway.com/template/deploy-ragflow-agent-workflows)**

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

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

## Template content

### 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

### 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

### 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 Agent (Open-Source RAG Engine) on Railway

This template runs a pinned RAGFlow 0.27.2 stack on Railway: the web UI plus Elasticsearch, MySQL, MinIO and Redis. It is for teams who want the Agent canvas, not just chat, wired to their own knowledge bases, with model keys added in the UI.

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

Your documents, parsed chunks, and session data stay in volumes you control: Elasticsearch, MySQL, MinIO, and Redis all run inside the project, and the only outbound calls go to whichever model provider you add keys for.

## Why Deploy RAGFlow Agent, the Dify alternative on Railway (Railway Free Trial)

Dify has a polished canvas, but its license adds conditions and hosted tiers meter usage. RAGFlow is Apache-2.0, runs on your own Railway services, and keeps parsed documents and API keys inside your project. Start on the $5 trial and test the canvas before scaling.

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

RAGFlow Agent needs five services, so hosting is really about who wires them together.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | Template deploys all five services, secrets generated | Droplets plus managed DBs you wire up yourself |
| AWS | One deploy, private networking, healthcheck before traffic | ECS, OpenSearch, RDS and S3 to configure yourself |
| Hetzner | Managed containers and volumes, restarts handled | Raw VMs where you set vm.max_map_count and patch Docker |

The trade is a few clicks versus an afternoon of compose debugging.

## Common Use Cases for hosted RAGFlow Agent

Once your dataset is parsed, these are the flows people actually build on the canvas:

- **After-sales triage:** a Categorize node sorts the question, then Retrieval pulls the matching product docs and Message answers with citations.
- **Intake bot with a ticket API:** an HTTP request node opens a work order, then the agent replies with the real ID instead of a canned apology.
- **Batch text processing:** loop over long documents, split them, and write structured summaries back into a dataset.
- **Embedded site assistant:** paste the embed snippet so visitors get answers from your docs without leaving the page.
- **Intent routing:** branch to different knowledge bases for billing, shipping, and returns, each with its own prompt.

## Dependencies for RAGFlow Agent Docker hosted on Railway

Five services: ragflow (infiniflow/ragflow:v0.27.2 digest-pinned; public port 80, API 9380, admin 9381, task executor; volume /ragflow/logs; health /api/v1/system/healthz, 900s timeout), Elasticsearch 8.11.3 (1 GB heap, volume /usr/share/elasticsearch/data), MinIO via pgsty/silo (volume /data), MySQL 8.4.11 (db rag_flow, volume /var/lib/mysql), Redis 8.2.10 (volume /data).

### Deployment Dependencies for Managed RAGFlow Agent Service (RAG Engine)

Deploys generate RAGFLOW_SECRET_KEY (signs sessions and API tokens), ADMIN_DEFAULT_PASSWORD for admin@ragflow.io, ELASTIC_PASSWORD, MINIO_ROOT_PASSWORD, MYSQL_ROOT_PASSWORD and REDIS_PASSWORD. Add LLM and embedding keys in the UI.

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

Start command: /ragflow/entrypoint.sh --enable-adminserver --init-model-provider-tables. Elasticsearch is single node with ML, mmap and memory lock off; on a VPS set vm.max_map_count 262144. Fixed: USE_DOCLING=false, DOC_BULK_SIZE=4, EMBEDDING_BATCH_SIZE=16, TZ=UTC. Docs may cover a newer release.

## How does RAGFlow Agent compare against other agentic RAG workflow builders

All four build agentic RAG flows; they differ in hosting and how much you code.

### RAGFlow vs Dify (Dify Alternative)

- **Parsing:** DeepDoc reads scans, tables and slides, and you inspect chunks first; Dify's ingestion is simpler.
- **Scope:** Dify adds a prompt IDE, logs, annotations and plugins; RAGFlow stays tight to parsing and retrieval.
- **Licensing:** RAGFlow is Apache-2.0; Dify's modified Apache license adds branding and resale conditions.
- **Where Dify wins:** team logs and prompt tooling out of the box.

### RAGFlow vs Flowise (Flowise Alternative)

- **Retrieval:** Flowise chains over your own vector store; RAGFlow ships parsing, chunk templates, hybrid search and rerank.
- **Nodes:** Flowise has more node types; RAGFlow keeps a small set: Begin, Agent, Retrieval, Categorize, Message, HTTP, code, loops.
- **Where Flowise wins:** arbitrary LangChain tools and per-node traces.

### RAGFlow vs LangGraph (LangGraph Alternative)

- **Canvas vs code:** LangGraph is code-first with state graphs and checkpointing; RAGFlow is clicks, quicker for intake bots.
- **Debugging:** LangGraph gives traces and testable nodes; on RAGFlow a Categorize node misrouting is fixed by reading prompts.
- **Where LangGraph wins:** retries, human-in-the-loop state and CI tests.

### RAGFlow vs Copilot Studio (Copilot Studio Alternative)

- **Hosting:** Copilot Studio is a closed Microsoft service tied to your tenant; RAGFlow self hosts, so documents stay yours.
- **Sources:** Copilot Studio connects cleanly to SharePoint and Dataverse; RAGFlow expects uploads and parsing.
- **Where Copilot Studio wins:** governed publishing into Teams with no infrastructure.

## How to use RAGFlow Agent (the OSS RAG engine with agent canvas)?

Chat handles plain Q&A. Switch to Agent when you need branching or tool calls.

1. Open your Railway domain and register the first account. The built-in admin is admin@ragflow.io.
2. Under Model providers, add a chat model and an embedding model, then set both as defaults.
3. Create a dataset, choose a chunking template, upload a few files and parse them.
4. Click Agent, then Create agent, and start from a template such as the after-sales flow.
5. Open the Retrieval component and point it at your dataset.
6. Run it in the test panel, check the cited chunks, then use Embed to get the snippet for your site.
7. Set REGISTER_ENABLED=0 once your accounts exist so strangers can't sign up.

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

Upstream ships a Docker Compose stack. Budget 4 cores, 16 GB RAM and 50 GB disk.

### Clone the Repository

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

### Install Dependencies

Install Docker 24+ and Compose, then raise the Elasticsearch mapping limit:

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

### Configure Environment Variables

Edit docker/.env in place: DOC_ENGINE=elasticsearch, MYSQL_PASSWORD, MINIO_PASSWORD, REDIS_PASSWORD. Pin RAGFLOW_IMAGE to the version you tested.

### Start the RAGFlow Agent Application

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

Open http://your-domain, register the first account, add model providers, then set REGISTER_ENABLED=0. Confirm /api/v1/system/healthz returns 200 before building agents.

Railway runs this same five-service stack, wires the secrets, pins the image, and restarts containers for you, with no sysctl step on your side.

## Official Pricing of RAGFlow Agent (RAGFlow pricing)

RAGFlow Agent is part of the open-source RAGFlow project under Apache-2.0, so the software itself costs nothing. There's no per-seat license and no feature gate on the Agent canvas: components, MCP tools, import and export, and the embed snippet are all in the same image you self host.

You pay for infrastructure and for the model tokens your agents use.

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

Self hosting keeps documents and embeddings on your own disk, and you pay for compute instead of seats. Cloud editions move that work elsewhere; the Agent canvas is the same.

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

Expect roughly $40-80 per month. Elasticsearch, MySQL, and the RAGFlow container with DeepDoc models each want several GB of RAM, and larger knowledge bases push that up. The software is Apache-2.0 and free; model keys live under Model providers and the model vendor bills them. Railway starts with a $5 trial.

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

Upstream asks for 4 CPU cores, 16 GB RAM, 50 GB disk, and Docker 24 or newer, plus vm.max_map_count at 262144 or Elasticsearch won't boot. On a VPS you also own TLS, backups, and upgrades.

## Frequently Asked Questions (FAQs)

### Should I use Chat or Agent?

Chat for plain document Q&A; Agent when you need branching, API calls, loops or steps before the model speaks.

### Can an agent call my own API?

Yes. Add an HTTP request component, set method, URL, headers and body, then wire its output into a Message or later node.

### Can it use MCP tools?

Yes. The Agent component accepts MCP tools and Retrieval attached as a tool; the model decides when to call them, so use a model with reliable tool calling.

### How do I embed an agent in my website?

Run it once in the test panel, then use the embed option to copy the snippet onto your page. Keep the service public and confirm it loads over HTTPS.

### Can I export an agent?

Yes, agents import and export. Export before upgrading the pinned image so you can rebuild the flow if a menu name shifts.

### Why does Retrieval return nothing?

Usually nothing is parsed yet, or the node points at another dataset. Check parsing finished, the similarity threshold and top-k, and the embedding model used at index time.


## 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-agent-workflows
