|Docs

Self-Host Open WebUI

open-webuidockerself-hosted

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.

Deploy on Railway

After deploying, skip to Configure LLM providers.

If you prefer manual setup, continue below.

Deploy from a Docker image

  1. Create a new project in Railway.
  2. Click + New and select Docker Image.
  3. Enter ghcr.io/open-webui/open-webui:main as the image name.
  4. Railway will pull the image and create a service.

Configure environment variables

Add the following variables under the Variables tab:

VariableValueDescription
PORT8080Port for the web interface
OLLAMA_BASE_URL(leave empty)Disables Ollama connection attempts
OPENAI_API_BASE_URLhttps://api.openai.com/v1OpenAI-compatible API endpoint
OPENAI_API_KEYYour API keyAPI key for OpenAI (or compatible provider)
WEBUI_SECRET_KEYA random stringSecret key for session management
DATA_DIR/app/backend/dataDirectory 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.

  1. Open the service in your project.
  2. Go to the Volumes tab.
  3. Click Add Volume.
  4. Set the mount path to /app/backend/data.
  5. Choose a size (2 GB is a reasonable starting point).
  6. Click Add.

Set up a public domain

  1. Go to the Settings tab of the service.
  2. Under Networking, click Generate Domain.
  3. Open the domain in your browser.

Configure LLM providers

  1. On first access, create an admin account.
  2. Go to Settings > Connections.
  3. Verify your OpenAI connection is active, or add additional providers.
  4. 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