Deploy Open WebUI [Jul'26]
Self-hosted AI chat UI for Ollama and OpenAI
openwebui-railway
Just deployed
/app/backend/data
Deploy and Host Open WebUI on Railway
Open WebUI is a self-hosted, feature-rich chat interface for AI models that you can deploy on Railway in minutes. It connects to Ollama for local LLMs and to any OpenAI-compatible API, giving you a polished ChatGPT-like experience with full data privacy and no per-seat fees.
About Hosting Open WebUI
Hosting Open WebUI requires running its Python-based web server alongside persistent storage for chat history, user accounts, and settings. It uses SQLite by default, so no separate database service is needed — but the SQLite file lives on disk, so attach a Railway volume mounted at /app/backend/data if you want chats and accounts to survive redeploys.
The app reads its configuration from environment variables at startup: your OpenAI API key or Ollama base URL, auth settings, and a secret key for session management. On Railway, the service deploys from a Dockerfile with a single click and gets a public HTTPS URL automatically.
Common Use Cases
- Private ChatGPT alternative — self-host a chat UI that works with any OpenAI-compatible API endpoint
- Shared Ollama front-end — connect a team to one Ollama instance through a multi-user web interface with per-user chat history
- Local LLM experimentation — run Llama 3, Mistral, or Phi through a browser without touching the terminal
Dependencies for Open WebUI Hosting
- AI provider — either an OpenAI API key (
OPENAI_API_KEY) or a reachable Ollama instance (OLLAMA_BASE_URL) - Secret key — a random string for session signing (
WEBUI_SECRET_KEY); generate one withopenssl rand -base64 32 - Persistent volume (recommended) — mounted at
/app/backend/dataso the SQLite database persists across deployments
Deployment Dependencies
- Open WebUI documentation
- Open WebUI GitHub repository
- Open WebUI environment variables reference
- Ollama — for running local LLMs
- Railway volumes documentation
Frequently Asked Questions
Does Open WebUI need a separate database?
No. Open WebUI ships with SQLite, so a single service is enough to get started. Postgres is supported via DATABASE_URL if you outgrow SQLite or need multiple replicas.
Will my chat history survive a redeploy?
Only with a persistent volume attached. Without one, the SQLite file is stored on ephemeral container storage and is wiped on every redeploy or restart.
Can I connect Open WebUI to Ollama running on my own machine?
The Railway deployment needs network access to your Ollama instance, so a laptop behind NAT won't work without a tunnel. Host Ollama on a publicly reachable machine, or point Open WebUI at an OpenAI-compatible API instead.
How do I control who can sign up?
The first account created becomes the admin. Set ENABLE_SIGNUP=false afterwards to close registration, or use WEBUI_AUTH and OAuth environment variables for stricter access control.
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 are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
openwebui-railway
Amritasha/openwebui-railway