---
title: "Deploy Open WebUI — Self-Hosted ChatGPT Alternative"
description: "Private multi-model AI chat — OpenAI, Claude, Ollama, built-in RAG"
category: "AI/ML"
url: https://railway.com/deploy/open-web-ui
---

# Deploy Open WebUI — Self-Hosted ChatGPT Alternative

Private multi-model AI chat — OpenAI, Claude, Ollama, built-in RAG

**[Deploy Open WebUI — Self-Hosted ChatGPT Alternative on Railway](https://railway.com/template/open-web-ui)**

- **Creator:** SilverBanana
- **Category:** AI/ML
- **Total deploys:** 46

## Template content

### open-webui https://res.cloudinary.com/dh2nt6hgh/image/upload/v1755973625/images_1_lv4h0d.png

- **Image:** ghcr.io/open-webui/open-webui:main
- **Public domain:** Yes

## Documentation

# Deploy and Host Open WebUI on Railway

![Open WebUI Interface](https://docs.openwebui.com/assets/images/demo-f704541c988ae735dde16b8baba17627.png)

Open WebUI is the world's most popular self-hosted AI chat platform — **136k+ GitHub stars**,
282 million container downloads, and the default recommendation in virtually every "private
ChatGPT alternative" guide published in 2026. Connect Ollama for local models, OpenAI,
Anthropic, DeepSeek, or any OpenAI-compatible API — all from one polished, ChatGPT-style
interface you fully own. Built-in RAG, multi-user access controls, Python tool runner, MCP
integration, and image generation — zero subscription fees, zero data sent to third parties.

---

## What This Template Deploys

| Service | Purpose |
|---|---|
| **Open WebUI** | The AI chat platform — multi-model interface, user management, RAG engine, and tool runner served on port `8080` |
| **Persistent Volume (`/app/backend/data`)** | Stores chat history, uploaded documents, user accounts, model configs, and RAG vector data across redeploys |

Single-service architecture. No database, no Redis, no inter-service networking required.

---

## About Hosting Open WebUI

Running Open WebUI in production requires a persistent volume for chat history and uploaded
documents, a public HTTPS endpoint for browser access, and secure environment variable handling
for LLM API credentials. Without a managed host, you're configuring Docker, managing volume
mounts, setting up SSL, and handling process restarts manually.

Railway provisions all of it automatically. This template deploys Open WebUI from the official
GitHub Container Registry image, mounts a persistent volume at `/app/backend/data`, and exposes
a public HTTPS URL immediately after deploy. Your chat history, user accounts, uploaded
documents, and RAG vector data survive every redeploy.

Typical cost: **~$5/month** on Railway's Hobby plan. ChatGPT Plus costs $20/month with usage
caps and OpenAI's data policies. Claude Pro costs $20/month. Open WebUI on Railway gives your
entire team access to multiple AI models at a flat ~$5/month compute cost — you pay only for
the LLM API tokens you actually use.

---

## Deploy in Under 5 Minutes

1. Click **Deploy on Railway** and wait for the build to complete (~2–3 minutes)
2. Set `WEBUI_SECRET_KEY` to a random 32-character string in the Variables tab
3. Set your LLM backend — `OPENAI_API_KEY` for OpenAI, or `OLLAMA_BASE_URL` for a local
   Ollama instance
4. Open your Railway-assigned URL — the Open WebUI login screen loads immediately
5. Create your admin account on first launch and start chatting

No SSH. No Docker configuration. No SSL certificates to manage.

![Open WebUI multi-model chat interface](YOUR_OPENWEBUI_MODELS_SCREENSHOT_URL_HERE)

---

## Common Use Cases

- **Self-hosted alternative to ChatGPT Plus** — give your team a shared AI workspace with
  user roles, conversation history, and admin controls for $5/month flat instead of $20/user
- **Self-hosted alternative to Claude.ai** — connect Anthropic's API directly and use Claude
  models through Open WebUI without a Claude.ai subscription; your conversations never leave
  your Railway instance
- **Private AI workspace for teams** — multi-user deployment with role-based access controls,
  shared prompt libraries, and conversation history your organisation fully owns
- **RAG-powered internal knowledge base** — upload PDFs, internal docs, and notes; query them
  with citations using Open WebUI's built-in retrieval-augmented generation engine
- **Multi-model comparison workspace** — connect Ollama, OpenAI, Anthropic, and DeepSeek
  simultaneously; switch or compare models mid-conversation without reconfiguring anything
- **Local LLM frontend via Ollama** — connect Open WebUI to an Ollama instance running
  Llama 4, DeepSeek V3, Qwen3, or Mistral Large for fully offline, zero-API-cost inference

---

## Configuration

| Variable | Required | Description |
|---|---|---|
| `WEBUI_SECRET_KEY` | ✅ Required | Session signing secret — generate a random 32+ character string |
| `OPENAI_API_KEY` | One of these | API key for OpenAI GPT models — enables OpenAI provider in the UI |
| `OLLAMA_BASE_URL` | One of these | URL of your Ollama service — e.g. `http://ollama.railway.internal:11434` |
| `ANTHROPIC_API_KEY` | Optional | API key for Anthropic Claude models |
| `DATA_DIR` | Pre-set | `/app/backend/data` — do not change unless migrating volumes |
| `PORT` | Pre-set | `8080` — auto-configured by Railway |
| `DEFAULT_MODELS` | Optional | Comma-separated default model IDs shown to new users on first login |
| `ENABLE_SIGNUP` | Optional | Set to `false` to disable self-registration — admin creates all accounts |
| `WEBUI_AUTH` | Optional | Set to `false` to disable authentication for single-user private deployments |
| `ENABLE_RAG_WEB_SEARCH` | Optional | Set to `true` to enable web search integration in RAG queries |

> You need at least one LLM backend: either `OPENAI_API_KEY` for a cloud provider or
> `OLLAMA_BASE_URL` pointing to a running Ollama instance. Both can be configured simultaneously.

---

## Open WebUI vs. Alternatives

| | Open WebUI (self-hosted) | ChatGPT Plus | Claude Pro | LibreChat |
|---|---|---|---|---|
| **Monthly cost** | ~$5 (Railway compute) | $20/user | $20/user | Free (self-hosted) |
| **Multi-model support** | ✅ Any provider | ❌ OpenAI only | ❌ Anthropic only | ✅ Yes |
| **Built-in RAG** | ✅ Yes | ⚠️ Limited | ⚠️ Limited | ⚠️ Plugin-based |
| **User roles and access control** | ✅ Yes | ❌ No | ❌ No | ✅ Yes |
| **Data ownership** | ✅ Your instance | ❌ OpenAI servers | ❌ Anthropic servers | ✅ Your instance |
| **Ollama (local LLM) support** | ✅ Native | ❌ No | ❌ No | ✅ Yes |
| **Python tool runner** | ✅ Built-in | ⚠️ Code interpreter | ❌ No | ❌ No |
| **MCP integration** | ✅ Yes | ⚠️ Limited | ✅ Yes | ❌ No |
| **Image generation** | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes |

---

## Dependencies for Open WebUI Hosting

- Railway account — Hobby plan (~$5/month) covers the single-service deployment
- At least one LLM backend: OpenAI API key, Anthropic API key, or a running Ollama instance
- Optional: a Railway Ollama template deployment for fully local model inference

### Deployment Dependencies

- [Open WebUI GitHub Repository](https://github.com/open-webui/open-webui) — source and releases
- [Open WebUI Documentation](https://docs.openwebui.com/) — full configuration reference
- [Ollama on Railway](https://railway.com/template/ollama) — local LLM backend template
- [Railway Volumes Documentation](https://docs.railway.com/volumes) — persistent storage setup
- [OpenAI API Keys](https://platform.openai.com/api-keys) — cloud LLM provider
- [Anthropic API Keys](https://console.anthropic.com/) — Claude model access

### Implementation Details

This template deploys Open WebUI from the official image at
`ghcr.io/open-webui/open-webui:main` with a Railway persistent volume mounted at
`/app/backend/data`. The volume stores the SQLite database (chat history, user accounts,
settings), uploaded documents for RAG, and vector embeddings — all filesystem-based with no
external database required.

Railway's HTTPS layer handles SSL termination and proxies traffic to port `8080`. On first
launch, Open WebUI prompts for admin account creation — this is the only setup step required
after deploy. All subsequent user creation, model configuration, and RAG setup happens through
the web UI.

---

## Frequently Asked Questions

**How much does Open WebUI cost on Railway compared to ChatGPT Plus?**
The Railway deployment runs at ~$5/month on the Hobby plan for the single container and volume.
ChatGPT Plus costs $20/user/month. For a team of five, that's $100/month vs $5/month — with
Open WebUI giving you access to multiple providers (OpenAI, Anthropic, Ollama) simultaneously.
LLM API token costs are separate and usage-based.

**Do I lose my chat history if Railway redeploys the container?**
No. All chat history, user accounts, RAG documents, and settings are stored on the Railway
persistent volume at `/app/backend/data`, not inside the container. Redeploys, image updates,
and container restarts do not affect your data.

**Can I connect both Ollama and OpenAI at the same time?**
Yes. Set both `OLLAMA_BASE_URL` and `OPENAI_API_KEY` in Railway Variables. Open WebUI
displays models from all configured providers simultaneously — users can switch between a local
Llama 4 model and GPT-4o in the same session without any reconfiguration.

**Can I use Open WebUI with Claude, DeepSeek, or other providers?**
Yes. Anthropic Claude connects via `ANTHROPIC_API_KEY`. DeepSeek and any OpenAI-compatible
provider connects via the OpenAI API base URL override. All configured providers appear as
selectable models in the interface.

**How do I restrict access so only my team can use it?**
Set `ENABLE_SIGNUP=false` to disable self-registration — only admin-created accounts can log
in. Open WebUI supports role-based access controls: admin, user, and pending states. For
single-user private deployments, set `WEBUI_AUTH=false` to skip authentication entirely.

**How do I update Open WebUI to a newer version?**
The template uses the `main` tag which pulls the latest release. To control versioning, change
the image tag in Railway service settings to a specific release (e.g.
`ghcr.io/open-webui/open-webui:v0.6.5`) and redeploy. Your volume data is unaffected.

---

## 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 the world's most popular self-hosted AI chat
platform — persistent chat history, built-in RAG, multi-model support, and team access
controls — at ~$5/month with no per-user fees and full ownership of your data.

## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/open-web-ui
