
Deploy RAGFlow Ollama
Point self-hosted RAGFlow at your own Ollama models
ragflow
Just deployed
/ragflow/logs
Redis
Just deployed
/data
Just deployed
/data
Elasticsearch
Just deployed
/usr/share/elasticsearch/data
MySQL
Just deployed
/var/lib/mysql
Deploy and Host RAGFlow Ollama (Open-Source RAG Engine) on Railway
This template deploys RAGFlow on Railway, ready to point at your own Ollama instance for chat and embedding models. Ollama runs separately, so you keep control of model weights and hardware. It suits teams wanting model flexibility and document Q&A without paying per-token API fees.
About Hosting RAGFlow Ollama on Railway (self hosted RAGFlow template)
This stack runs the full RAGFlow engine on Railway: nginx, task executor, Elasticsearch, MinIO, MySQL, and Redis. Your parsed documents, chunk indexes, and chat history stay in your Railway volumes.
Why Deploy RAGFlow Ollama on Railway (Railway Free Trial)
Self-hosted RAGFlow with Ollama keeps your models and data under your control, and Railway's $5 trial covers a first CPU-only run.
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 Ollama 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 Ollama self hosting
Railway gives you a private network for an Ollama service you add next to RAGFlow, while these providers need more manual wiring.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | Private network to an Ollama service you add, volumes, no port exposure | Droplets with block storage, you set up Docker and networking yourself |
| AWS | Same managed private networking, plus simple service scaling | EC2 or ECS with VPC, IAM, and more ops overhead for RAGFlow plus Ollama |
| Hetzner | One-click RAGFlow template, Ollama service on same private network | Cheap bare metal or cloud VPS, but you manage every dependency and firewall |
For a GPU-backed Ollama, you can still run it on any of these and point RAGFlow at it over a private tunnel.
Common Use Cases for hosted RAGFlow Ollama
-
Private document Q&A without API fees: Use RAGFlow's DeepDoc parsing with Ollama chat models on your own GPU box, so sensitive PDFs never leave your network and you skip per-token costs.
-
Cheap embeddings on Railway CPU: Pull a small Ollama embedding model like qwen3-embedding:0.6b onto a Railway service, parse datasets repeatedly without hosted embedding fees, and save larger chat models for a GPU machine.
-
Regulated workloads: Keep the whole stack, including model inference, on infrastructure you control, so documents and prompts never go to a third-party model API.
-
Affordable RAG workflow testing: Try different chunking templates and hybrid search settings while Ollama serves local models, paying only for compute instead of model API usage.
Dependencies for RAGFlow Docker hosted on Railway
RAGFlow's Railway template runs ragflow, Elasticsearch, MinIO, MySQL, and Redis. Add its base URL in the UI under Model providers; model keys are never env vars.
Deployment Dependencies for Managed RAGFlow Service (RAG Engine)
- ragflow: port 80, volume /ragflow/logs, health /api/v1/system/healthz, start /ragflow/entrypoint.sh --enable-adminserver --init-model-provider-tables.
- Elasticsearch 8.11.3: doc engine, 1 GB heap, volume /usr/share/elasticsearch/data.
- MinIO (pgsty/silo): S3 store, volume /data.
- MySQL 8.4.11: database rag_flow, volume /var/lib/mysql.
- Redis 8.2.10: queue, locks, caches, volume /data.
Generated: RAGFLOW_SECRET_KEY, ADMIN_DEFAULT_PASSWORD, and passwords for Elasticsearch, MinIO, MySQL, Redis. Fixed: DOC_ENGINE=elasticsearch, DEVICE=cpu, DB_TYPE=mysql, REGISTER_ENABLED=1, HF_ENDPOINT=https://huggingface.co.
Implementation Details for RAGFlow (Using RAGFlow official docker image)
The official image runs with these env vars; Elasticsearch has ML, mmap, and memory lock off. Changing the embedding model later means re-parsing the dataset. Railway services are CPU-only, so small embedding models work but large chat models are slow.
How does RAGFlow compare against other RAG platforms
RAGFlow stands out for deep document parsing and visual chunk control; other tools win on app breadth or setup speed.
RAGFlow vs Dify (Dify Alternative)
- Focus: RAGFlow is document-first; Dify is an LLM app builder with RAG as one component.
- Parsing: RAGFlow's DeepDoc handles scanned PDFs and tables better; Dify needs extra parsers.
- Dify wins: Dify has more ready-made app templates and plugins for non-RAG workflows.
RAGFlow vs AnythingLLM (AnythingLLM Alternative)
- Setup: AnythingLLM is one container; RAGFlow is a multi-service stack.
- Search: RAGFlow adds hybrid search, reranking, and citation tracing; AnythingLLM is simpler.
- AnythingLLM wins: For a few documents on a small box, AnythingLLM deploys faster and uses less RAM.
RAGFlow vs Onyx (Onyx Alternative)
- Connectors: Onyx has more enterprise data source connectors; RAGFlow has fewer out of the box.
- Parsing: RAGFlow's DeepDoc is stronger for complex PDFs; Onyx relies on standard extraction.
- Onyx wins: For org-wide search over Slack, Confluence, and Drive, Onyx's connector library is ahead.
RAGFlow vs LlamaIndex (LlamaIndex Alternative)
- Type: RAGFlow is a deployable app with a UI; LlamaIndex is a code-first Python framework.
- Control: LlamaIndex gives programmatic pipeline control; RAGFlow abstracts that into a GUI plus API.
- LlamaIndex wins: Developers building custom pipelines get more flexibility with LlamaIndex.
How to use RAGFlow Ollama (the OSS RAG engine)?
- Run Ollama as a separate Railway service with a volume on /root/.ollama. Set OLLAMA_HOST to listen on :: for private networking.
- Pull a chat model and an embedding model inside Ollama, e.g. ollama pull qwen3-embedding:0.6b.
- In RAGFlow, go to Model providers, add Ollama with base URL http://ollama.railway.internal:11434, leave API Key empty.
- Add chat model as type Chat and embedding as type Embedding, names must exactly match Ollama. Verify and save.
- Under Set default models pick them, and choose the embedding model when creating a dataset. CPU-only Railway suits small embeddings; large chat models are slow.
How to self host RAGFlow on other VPS Services (RAGFlow self hosting guide)
Clone the Repository
Clone the upstream repo from GitHub and enter the Docker directory. This is the same source used by the Railway template.
git clone https://github.com/infiniflow/ragflow
cd ragflow/docker
Install Dependencies
Install Docker 24+ and Docker Compose on a VPS with at least 4 CPU cores, 16 GB RAM, and 50 GB disk. Set the host kernel parameter for Elasticsearch: vm.max_map_count=262144.
Configure Environment Variables
Edit docker/.env, which ships with default passwords such as infini_rag_flow; change every one before exposing the server. Keep the default ports unless you have a conflict. Model provider keys are added later in the RAGFlow UI, not in this file.
Start the RAGFlow Application
Start the stack with Docker Compose and wait for the health check to pass. Then open http://your-domain and register your first account.
docker compose -f docker-compose.yml up -d
Railway handles this whole sequence for you: cloning, dependencies, environment configuration, and container startup are pre-wired in the one-click template.
Official Pricing of RAGFlow (RAGFlow pricing)
RAGFlow is open source under Apache-2.0 and free to self host. There is no license fee for RAGFlow itself, and pulling Ollama chat and embedding models costs nothing beyond disk and compute.
RAGFlow cloud vs self hosted comparison (Pricing, features, costs, and more)
Cloud hosting removes the infra work, but self hosting means you own the models, data, and cost. The trade-off is RAM and disk, not licensing.
Monthly cost of self hosting RAGFlow on Railway
On Railway, expect roughly $40-80 per month because Elasticsearch, MySQL, and the RAGFlow container with DeepDoc models need several GB of RAM. Large knowledge bases push higher. The $5 trial lets you test before committing.
System Requirements for Hosting RAGFlow on a VPS
Upstream minimums for a VPS are 4 CPU cores, 16 GB RAM, 50 GB disk, and Docker 24+. Set vm.max_map_count to 262144 for Elasticsearch. A separate GPU machine is better for larger chat models.
Frequently Asked Questions (FAQs)
Does RAGFlow bundle Ollama on Railway?
No. RAGFlow does not bundle Ollama. You run Ollama as a separate Railway service with a volume on /root/.ollama, or point RAGFlow at a GPU machine you own.
How do I connect Ollama to RAGFlow?
Pull a chat model and an embedding model in Ollama first. Then in RAGFlow, open Model providers, add an Ollama provider with the base URL, leave API Key empty, add both models by exact name, verify, and set them as defaults.
Can I expose Ollama port 11434 publicly?
Do not expose port 11434 publicly without auth. On Railway, use Ollama's private domain like http://ollama.railway.internal:11434 and set OLLAMA_HOST to listen on :: so private networking works.
Why are chat models slow on Railway?
Railway services are CPU-only, so large chat models crawl. Small embedding models like qwen3-embedding:0.6b are fine on CPU, but a GPU box over a private network or tunnel is better for chat.
What happens if I change the embedding model later?
You will need to re-parse every dataset because chunks are embedded with the old model. Pick the embedding model before you upload and parse a knowledge base.
Do I need API keys for Ollama in RAGFlow?
No, leave the API Key field empty for a local Ollama instance. RAGFlow only needs the base URL and the model names that match Ollama's list exactly.
Template Content
ragflow
infiniflow/ragflow:v0.27.2Redis
redis:8.2.10Elasticsearch
elasticsearch:8.11.3MySQL
mysql:8.4.11