Railway

Deploy Open WebUI — Self-Hosted RAG & Document AI Chat

Self-host Open WebUI — chat with your PDFs & docs, privately

Deploy Open WebUI — Self-Hosted RAG & Document AI Chat

Just deployed

/app/backend/data

Deploy and Host Open WebUI on Railway

Open WebUI is a self-hosted AI interface with a powerful built-in RAG engine — upload your PDFs, Word docs, and text files, and chat with them privately, with source citations. Beyond document chat it adds web search, knowledge-base collections, custom assistants, and a polished ChatGPT-style UI, all connected to the AI provider of your choice. This template deploys it in API mode, so you bring an OpenAI, Anthropic, OpenRouter, or Groq key and get a private, self-hosted "chat with your documents" workspace on your own infrastructure — no GPU required.


What This Template Deploys

ServicePurpose
Open WebUIThe chat interface, RAG engine, and document knowledge base

A single service with a persistent volume for your documents, embeddings, conversations, and settings. It connects to an external AI provider over its API, so no GPU or local model server is needed — ideal for Railway.


About Hosting

Open WebUI is best known as a ChatGPT-style front end, but its document-RAG capabilities are the standout, and this template is set up around them.

Chat with your documents — the built-in RAG engine. Upload PDFs, DOCX, TXT, and Markdown, and Open WebUI chunks, embeds, and stores them in a vector database, so you can ask questions and get answers grounded in your files, with source citations. Group documents into knowledge-base collections (say, "Company Financials" or "Product Docs") and reference them in any chat. Your documents never leave your infrastructure — private RAG without a third-party service.

Run it in API mode — no GPU needed. Railway has no GPU, so instead of slow local models, this template connects Open WebUI to a hosted AI provider over its API — OpenAI, Anthropic, OpenRouter, Groq, or any OpenAI-compatible endpoint. You get fast responses and strong models, pay the provider directly for usage, and Open WebUI handles the interface, documents, and RAG. This is the right fit for Railway: the heavy inference runs on the provider, the lightweight UI and RAG run here.

Web search built in. Open WebUI can query a search provider per conversation — 15+ options including self-hosted SearXNG — injecting fresh results into the context, so answers reflect current information alongside your documents.

Persist the volume — it holds your documents and history. Your uploaded files, embeddings, conversations, and settings live on the mounted volume. Without it, a redeploy wipes your knowledge base and chat history. This template mounts it so everything persists.

Multi-user with the first account as admin. The first account you create becomes the administrator; set WEBUI_SECRET_KEY to a stable value so sessions and tokens stay valid. Add team members with role-based access, each with their own private chats and documents, and no per-user fees.

Custom assistants and workflows. Define reusable personas with fixed system prompts — a document summarizer, a contract reviewer, a research assistant — and pair them with your knowledge bases for repeatable, document-grounded workflows.

Typical cost: ~$5–10/month on Railway for the interface and storage, plus what you pay your AI provider for usage. Open WebUI is free and open source.


How It Compares

Open WebUI RAG (self-hosted)ChatGPT + filesNotebookLMCloud RAG SaaS
Document privacyFull — your infraVendorGoogleVendor
Provider choiceAny (OpenAI, Anthropic…)OpenAI onlyGoogle onlyVendor's
Knowledge basesYes, persistentPer-chatNotebooksYes
Source citationsYesLimitedYesVaries
Cost modelFlat infra + APISubscriptionSubscriptionPer seat/usage
Self-hostableYesNoNoNo

ChatGPT and NotebookLM handle documents well but keep your files on a vendor's servers and lock you to one provider. Cloud RAG platforms bill per seat and hold your data. Open WebUI's edge is a private, self-hosted RAG workspace — your documents chunked and embedded on your own infrastructure, queried through whichever AI provider you choose, with citations and persistent knowledge bases — at flat cost with full data ownership.


Deploy in Under 5 Minutes

  1. Click Deploy on Railway — Open WebUI builds with a volume for documents and data (~2 minutes)
  2. Set WEBUI_SECRET_KEY and confirm the volume is mounted
  3. Add your AI provider API key (OpenAI, Anthropic, OpenRouter, or Groq) in settings
  4. Open your Railway domain and create your admin account
  5. Upload documents to a knowledge base, then chat with them using # to reference a collection

Toggle web search per conversation to blend live results with your document answers.


Common Use Cases

  • Chat with your PDFs — upload documents and get answers grounded in them, with source citations
  • Private knowledge base — build searchable collections of your docs and query them by meaning
  • Research assistant — combine document RAG with web search for grounded, current answers
  • Contract and report analysis — ask questions across long documents instead of reading end to end
  • Private ChatGPT alternative — a polished multi-model chat UI with your data on your own infra

Configuration

VariableRequiredDescription
WEBUI_SECRET_KEYRequiredSigns sessions and tokens — set a stable value
OPENAI_API_BASE_URLRecommendedProvider endpoint (OpenAI, OpenRouter, Groq, or compatible)
OPENAI_API_KEYRecommendedYour AI provider key for chat and embeddings
ENABLE_OLLAMA_APIOptionalfalse in API mode, since no local model server runs here
Storage volumePre-setPersistent volume for documents, embeddings, and chats

Persist the volume and set the secret key. Documents, embeddings, and chat history live on the volume — without it, a redeploy wipes your knowledge base. Set a stable WEBUI_SECRET_KEY so sessions stay valid.

Use API mode on Railway. Railway has no GPU, so connect a hosted provider (OpenAI, Anthropic, OpenRouter, Groq) via its API rather than running local models. The interface and RAG run here; inference runs on the provider.


Dependencies for Open WebUI Hosting

  • Railway account — ~$5–10/month plus your AI provider usage
  • An AI provider API key (OpenAI, Anthropic, OpenRouter, Groq, or compatible)
  • A persistent Railway volume for documents, embeddings, and chats (included)
  • Optional: a self-hosted SearXNG instance for private web search

Deployment Dependencies

Implementation Details

The template runs the official ghcr.io/open-webui/open-webui image as a single service with a persistent volume for documents, embeddings, conversations, and settings. It is configured for API mode: rather than running local models (impractical without a GPU on Railway), it connects to a hosted provider through OPENAI_API_BASE_URL and OPENAI_API_KEY, so inference and embeddings run on OpenAI, Anthropic, OpenRouter, Groq, or any OpenAI-compatible endpoint, while the lightweight interface and RAG engine run on Railway.

The built-in RAG engine ingests uploaded PDF, DOCX, TXT, and Markdown files, chunking and embedding them into a vector store so users can query their documents with source-cited answers, organized into reusable knowledge-base collections. Web search is available per conversation across many providers, including self-hosted SearXNG. WEBUI_SECRET_KEY signs sessions and must remain stable, the first registered account becomes the admin, and role-based access supports multiple users with private chats and documents. All data persists on the volume, which is the component to back up.


Frequently Asked Questions

Can I chat with my own documents? Yes — that's the focus here. Upload PDFs, Word docs, or text files, and Open WebUI's RAG engine embeds them so you can ask questions and get answers grounded in your files, with source citations, all privately on your infrastructure.

Do I need a GPU? No. This template runs in API mode, connecting to a hosted provider (OpenAI, Anthropic, OpenRouter, Groq) over its API, so no GPU or local model server is needed — a good fit for Railway.

Where do my documents go? They stay on your Railway volume — chunked and embedded locally into a vector store. Your files don't leave your infrastructure, unlike uploading to a cloud AI service.

Can it search the web too? Yes. Web search can be toggled per conversation across 15+ providers, including self-hosted SearXNG, blending current results with your document knowledge.

Can my team use it? Yes — it's multi-user with role-based access. The first account is admin, and each user gets private chats and documents, with no per-user fees.

Which providers work? Any OpenAI-compatible endpoint — OpenAI, Anthropic (via compatible proxies), OpenRouter, Groq, and others — set through the API base URL and key.


Why Deploy Open WebUI 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 Open WebUI on Railway you get a private, self-hosted RAG workspace — chat with your documents, backed by the AI provider you choose, with a persistent volume, API mode so no GPU is needed, and automatic HTTPS. Your documents and conversations stay on infrastructure you own.


Template Content

More templates in this category

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

okisdev
113
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
1
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
56