Self-Host Open WebUI
Open WebUI is an open-source chat interface for interacting with LLMs. It provides a ChatGPT-like experience that you control, with support for multiple model providers, conversation history, file uploads, and user management.
Open WebUI is commonly paired with Ollama for local model inference, but Railway does not offer GPU instances. This guide configures Open WebUI to connect to external LLM APIs (OpenAI, Anthropic, etc.) instead.
What you will set up
- An Open WebUI instance running from the official Docker image
- Persistent storage for conversation history and uploaded files
- Connection to external LLM APIs (not Ollama)
- A public domain for accessing the chat interface
One-click deploy from a template
Railway has an Open WebUI template that provisions the setup in one step.
After deploying, skip to Configure LLM providers.
If you prefer manual setup, continue below.
Deploy from a Docker image
- Create a new project in Railway.
- Click + New and select Docker Image.
- Enter
ghcr.io/open-webui/open-webui:mainas the image name. - Railway will pull the image and create a service.
Configure environment variables
Add the following variables under the Variables tab:
| Variable | Value | Description |
|---|---|---|
PORT | 8080 | Port for the web interface |
OLLAMA_BASE_URL | (leave empty) | Disables Ollama connection attempts |
OPENAI_API_BASE_URL | https://api.openai.com/v1 | OpenAI-compatible API endpoint |
OPENAI_API_KEY | Your API key | API key for OpenAI (or compatible provider) |
WEBUI_SECRET_KEY | A random string | Secret key for session management |
DATA_DIR | /app/backend/data | Directory for persistent data |
To use Anthropic or other providers, configure them through the Open WebUI settings after first login. Open WebUI supports multiple concurrent providers.
Attach persistent storage
Open WebUI stores conversations, uploaded files, and user data in /app/backend/data. Without a volume, this data is lost on each deployment.
- Open the service in your project.
- Go to the Volumes tab.
- Click Add Volume.
- Set the mount path to
/app/backend/data. - Choose a size (2 GB is a reasonable starting point).
- Click Add.
Set up a public domain
- Go to the Settings tab of the service.
- Under Networking, click Generate Domain.
- Open the domain in your browser.
Configure LLM providers
- On first access, create an admin account.
- Go to Settings > Connections.
- Verify your OpenAI connection is active, or add additional providers.
- Models from connected providers will appear in the model selector dropdown.
Open WebUI supports any OpenAI-compatible API endpoint. This includes providers like Anthropic (via their OpenAI-compatible endpoint), Together AI, Groq, and Fireworks.
GPU and Ollama
Open WebUI is often used with Ollama for running models locally. Railway does not offer GPU instances, so running Ollama with production-sized models is not practical on Railway. If you need local inference, connect Open WebUI on Railway to an Ollama instance running on a GPU-equipped server elsewhere by setting OLLAMA_BASE_URL to that server's address.
Next steps
- Manage Volumes: Resize or back up your persistent storage.
- Set up a custom domain: Use your own domain for the interface.
- Monitor your app: View logs and metrics.
- Self-Host Flowise: A visual builder for LLM chains and workflows.