Railway

Deploy RAGFlow

RAG engine with document parsing, citations, and agentic workflows

Deploy RAGFlow

Redis-VQKm

redis:8.2.1

Just deployed

/data

Just deployed

Just deployed

/data

Just deployed

/usr/share/elasticsearch/data

MySQL-WRvL

mysql:9.4

Just deployed

/var/lib/mysql

Deploy and Host RAGFlow on Railway

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine built on deep document understanding. It extracts knowledge from PDFs, Word docs, Excel, PPTs, images, and more using layout-aware parsing that preserves document structure. Every answer comes with traceable citations to source documents. Connect any LLM provider, build complex retrieval workflows with the visual agent editor, and deploy the full stack in one click.

About Hosting RAGFlow

The template deploys five services on Railway's private network. RAGFlow runs as a Docker container (~5GB image) with nginx serving the React frontend and proxying API requests to the Python backend on port 9380. Elasticsearch handles vector search and document indexing. MySQL stores metadata, user data, and configuration. MinIO provides S3-compatible object storage for uploaded documents. Redis manages caching, sessions, and task queues. All services communicate over Railway's internal network using private domains. The RAGFlow container uses a custom start script that configures nginx at runtime and delegates to the original entrypoint for database initialization and worker processes.

Common Use Cases

  • Building internal knowledge bases from company documents (contracts, manuals, policies) with citation-backed Q&A accessible to the entire team
  • Deploying a self-hosted alternative to ChatGPT with your own data, keeping sensitive documents on infrastructure you control
  • Creating customer support assistants that answer questions from product documentation, FAQs, and support tickets with source references

Dependencies for Hosting

  • A Railway account with sufficient resources (~8GB RAM total across services, ~83GB storage)
  • An LLM API key (OpenAI, Anthropic, DeepSeek, or any OpenAI-compatible endpoint) configured after first login

Deployment Dependencies

Why Deploy on Railway?

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 on Railway, you are one step closer to supporting a complete AI-powered knowledge base with minimal burden. Host your servers, databases, AI agents, and more on Railway.


What's Inside

A production-ready deployment of RAGFlow with all required infrastructure services configured and connected.

ServiceTechnologyRole
RAGFlowinfiniflow/ragflow v0.24.0RAG engine with web UI, REST API, and document processing
ElasticsearchElasticsearch 8.11.3Vector search, document indexing, and full-text retrieval
MySQLMySQL 8.0 (Railway native)Metadata, user data, and configuration storage
MinIOMinIO (S3-compatible)Object storage for uploaded documents and files
RedisValkey 8 (Railway native)Caching, session management, and task queues

Why RAGFlow

Deep Document Understanding goes beyond naive chunking. RAGFlow uses layout-aware parsing to extract knowledge from PDFs, Word, Excel, PPTs, and images while preserving document structure and context.

Citation-backed Answers means every response includes traceable references to source documents. No hallucinated answers, no guessing. Users can verify exactly where each piece of information came from.

Multi-model Flexibility lets you connect any LLM provider: OpenAI, Anthropic, DeepSeek, local models via Ollama, or any OpenAI-compatible API. Switch models without changing your knowledge base.

Agentic RAG provides a visual workflow editor for building complex retrieval pipelines. Combine multiple knowledge bases, add reasoning steps, and create sophisticated Q&A workflows without code.


Architecture

                    ┌─────────────────┐
                    │   User Browser  │
                    └────────┬────────┘
                             │ :80
                    ┌────────▼────────┐
                    │    RAGFlow      │
                    │  (Web UI + API) │
                    └──┬──┬──┬──┬────┘
           ┌───────────┘  │  │  └───────────┐
           │              │  │              │
    ┌──────▼──────┐ ┌─────▼──▼─────┐ ┌─────▼─────┐
    │ Elasticsearch│ │    MySQL     │ │   MinIO   │
    │   :9200     │ │    :3306     │ │   :9000   │
    │  (vectors)  │ │  (metadata)  │ │  (files)  │
    └─────────────┘ └──────────────┘ └───────────┘
                           │
                    ┌──────▼──────┐
                    │    Redis    │
                    │    :6379    │
                    │   (cache)   │
                    └─────────────┘

Key Features

  • Template-based Chunking preserves document structure during parsing
  • Multi-format Support handles PDF, Word, Excel, PPT, images, markdown, and more
  • Visual Agent Editor for building complex RAG workflows without code
  • MCP Server built-in for Model Context Protocol tool integration
  • REST API for programmatic access to all RAGFlow capabilities
  • Multi-tenant with user registration and role-based access

Deploy to Railway

Click the button above or:

  1. Fork this repo
  2. Create a new project on Railway
  3. Add a MySQL database (Railway native)
  4. Add a Redis database (Railway native)
  5. Add three services from your forked repo, each pointing to a subdirectory:
ServiceRoot DirectoryPort
RAGFlowragflow/80
Elasticsearchelasticsearch/9200
MinIOminio/9000
  1. Set environment variables on RAGFlow (see below) referencing the other services
  2. Generate a domain for the RAGFlow service
  3. Deploy

After Deployment

  1. Access the RAGFlow web UI through the public URL Railway assigns
  2. Create an admin account on first visit
  3. Go to Model Providers and configure at least one LLM (OpenAI, Anthropic, Ollama, etc.)
  4. Create a Knowledge Base and upload your documents
  5. Create an Assistant linked to your knowledge base
  6. Start asking questions with citation-backed answers

Environment Variables

RAGFlow

VariableRequiredDefaultDescription
MYSQL_HOSTYes-${{MySQL.RAILWAY_PRIVATE_DOMAIN}}
MYSQL_PORTNo3306MySQL port
MYSQL_PASSWORDYes-${{MySQL.MYSQL_ROOT_PASSWORD}}
MYSQL_DBNAMENorag_flowDatabase name
MYSQL_USERNorootDatabase user
ES_HOSTYes-${{Elasticsearch.RAILWAY_PRIVATE_DOMAIN}}
ELASTIC_PASSWORDYes-${{Elasticsearch.ELASTIC_PASSWORD}}
MINIO_HOSTYes-${{MinIO.RAILWAY_PRIVATE_DOMAIN}}
MINIO_PASSWORDYes-${{MinIO.MINIO_ROOT_PASSWORD}}
MINIO_USERNorag_flowMinIO access key
MINIO_PORTNo9000MinIO API port
REDIS_HOSTYes-${{Redis.RAILWAY_PRIVATE_DOMAIN}}
REDIS_PASSWORDYes-${{Redis.REDIS_PASSWORD}}
REDIS_USERNAMENodefaultRedis username (Railway native uses default)
REDIS_PORTNo6379Redis port
DOC_ENGINENoelasticsearchVector DB engine
REGISTER_ENABLEDNo1User registration (1 = on, 0 = off)
PORTNo80Port Railway routes traffic to
TZNoUTCTimezone

Elasticsearch

VariableRequiredDefaultDescription
ELASTIC_PASSWORDYes-Password for the elastic user
ES_JAVA_OPTSNo-Xms1g -Xmx1gJVM heap size

MinIO

VariableRequiredDefaultDescription
MINIO_ROOT_USERNorag_flowMinIO access key
MINIO_ROOT_PASSWORDYes-MinIO secret key

Resource Requirements

RAGFlow is resource-intensive. Recommended minimums:

ServiceRAMStorage
RAGFlow4 GB2 GB
Elasticsearch2 GB20 GB
MySQL1 GB10 GB
MinIO512 MB50 GB
Redis512 MB1 GB
Total~8 GB~83 GB

Upstream

This template deploys RAGFlow by InfiniFlow. All credit for the RAG engine goes to the original maintainers.


License

MIT


Built by AToolZ


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
View Template
EchoDeck
Generate a mp4 from powerpoint with TTS

Fixed Scope
View Template
openui
Deploy OpenUI: AI-powered UI generation with GitHub OAuth and OpenAI API.

zexd