Deploy OpenWebUI [Updated Sep'26]

Self-host Open WebUI for teams — durable Postgres, scalable sessions

Deploy OpenWebUI [Updated Sep'26]

/var/lib/postgresql/data

Just deployed

Just deployed

/data

Deploy and Host Open WebUI on Railway

Open WebUI is the most popular self-hosted AI chat interface — a private, ChatGPT-style UI for OpenAI, Anthropic, and other models, with multi-user accounts, roles, and built-in RAG. This template deploys it production-grade: PostgreSQL for durable data that survives every redeploy, and Redis for shared session and WebSocket state so it scales cleanly across multiple instances. It's the setup for a team that depends on Open WebUI daily — where the default single-container SQLite build isn't enough — with authentication and persistence wired from the first deploy.


What This Template Deploys

ServicePurpose
Open WebUIThe AI chat interface — multi-model UI, users, roles, RAG (port 8080)
PostgreSQLDurable storage for chats, users, settings, and documents
RedisShared session, cache, and WebSocket state for multi-instance scaling

All three connect over Railway's private network. Open WebUI serves the chat UI, PostgreSQL replaces the default SQLite for reliable persistence, and Redis holds shared state so you can run more than one instance — a production stack for teams.


About Hosting

This is Open WebUI built for teams and production, and the Postgres and Redis wiring is exactly what the default deploy lacks — both handled here.

PostgreSQL for durable data — not fragile SQLite. By default Open WebUI stores everything in a single SQLite file, which is fine for one user but a liability for a team: it's a single point of failure, harder to back up, and strained by concurrent writes. This template wires DATABASE_URL to a managed PostgreSQL, so all chats, users, settings, and documents live in a real database that survives redeploys, backs up cleanly, and handles many users writing at once. This is the difference between a personal instance and one a team relies on.

Redis scales sessions and WebSockets across instances. A single Open WebUI container keeps session and live-chat (WebSocket) state in memory, so you can't run more than one — a second instance wouldn't share logins or streams. This template wires Redis for shared session, cache, and WebSocket state, so Open WebUI can run multiple replicas behind Railway's load balancing without users being logged out or losing streaming responses. It's what makes the deployment horizontally scalable.

Authenticated and private from boot. Set WEBUI_SECRET_KEY to a stable value, create the first admin account, and set ENABLE_SIGNUP=false so the workspace stays behind a login. Every conversation and document stays on your infrastructure, with role-based access for team members — no per-seat fees and no data sent to a vendor.

Bring your own models, with built-in RAG. Add OPENAI_API_KEY, ANTHROPIC_API_KEY, or point at any OpenAI-compatible endpoint, and those models appear in the interface, selectable per chat, with inference running on your provider. Open WebUI also includes document upload with retrieval-augmented generation, a tool runner, and model management, so your team queries internal documents from the same private UI — all backed by the durable Postgres store.

Typical cost: ~$10–15/month on Railway for Open WebUI, PostgreSQL, and Redis — more than a single-container deploy, but the reliability and scaling are the point for team use. Open WebUI is free and open source.


How It Compares

Open WebUI + Postgres/RedisOpen WebUI (SQLite)ChatGPT TeamCloud AI SaaS
Durable databasePostgreSQLSingle SQLite fileVendorVendor
Multi-instance scalingYes (Redis)NoManagedManaged
Multi-user + rolesYesYesYesVaries
Cost modelFlat infraFlat infraPer seatPer seat
Data ownershipFull — your infraFullVendorVendor
Self-hostableYesYesNoNo

A default single-container Open WebUI on SQLite is great for one person but doesn't back up cleanly or scale past one instance. ChatGPT Team and cloud AI platforms are managed but bill per seat and keep your data. This stack's edge is Open WebUI run the way a team needs it — durable Postgres storage and Redis-backed scaling — self-hosted, with every conversation on infrastructure you own and no per-seat cost.


Deploy in Under 5 Minutes

  1. Click Deploy on Railway — Open WebUI, PostgreSQL, and Redis build and wire together (~3 minutes)
  2. Confirm DATABASE_URL and the Redis connection are set, and set WEBUI_SECRET_KEY
  3. Add OPENAI_API_KEY, ANTHROPIC_API_KEY, or an OpenAI-compatible endpoint
  4. Open your Railway URL, create your admin account, and set ENABLE_SIGNUP=false
  5. Invite your team, and scale to multiple instances as usage grows — Redis keeps sessions shared

Your chats and users live in Postgres, so they survive every redeploy and back up cleanly.


Common Use Cases

  • Team AI workspace — a shared, private ChatGPT-style UI with durable data and roles
  • Production Open WebUI — Postgres persistence and Redis scaling for daily-driver reliability
  • Private document AI — RAG over internal docs, backed by a real database
  • Multi-model front-end — one private UI over OpenAI, Anthropic, and compatible endpoints

Configuration

VariableRequiredDescription
DATABASE_URLAuto-injectedPostgreSQL connection — durable storage, not SQLite
Redis connectionAuto-injectedShared session, cache, and WebSocket state for scaling
WEBUI_SECRET_KEYRequiredSigns sessions — set a stable random value
ENABLE_SIGNUPRecommendedfalse after creating your admin, so no one else registers
OPENAI_API_KEY / ANTHROPIC_API_KEYOptionalAdd cloud models (or an OpenAI-compatible endpoint)

Postgres and Redis are the point. DATABASE_URL puts all data in durable PostgreSQL (surviving redeploys, backing up cleanly), and Redis shares session and WebSocket state so you can run multiple instances — both wired here, unlike a default SQLite build.

Lock it down. Set a stable WEBUI_SECRET_KEY, create your admin, and set ENABLE_SIGNUP=false so the workspace stays private with role-based access.


Dependencies for Open WebUI Hosting

  • Railway account — ~$10–15/month for Open WebUI, PostgreSQL, and Redis
  • PostgreSQL and Redis (both included and wired via Railway references)
  • An LLM provider key or OpenAI-compatible endpoint for models
  • A modern browser; invite team members from the admin settings

Deployment Dependencies

Implementation Details

The template runs the official ghcr.io/open-webui/open-webui image on port 8080, wired to a Railway-managed PostgreSQL database via DATABASE_URL and a Redis service over the private network. PostgreSQL replaces Open WebUI's default SQLite store so chats, users, settings, and documents persist durably, back up cleanly, and tolerate concurrent writes from many users; Redis holds shared session, cache, and WebSocket state, which is what allows more than one Open WebUI instance to run behind load balancing without breaking logins or streaming responses.

Authentication is enabled with WEBUI_SECRET_KEY signing sessions, the first account as administrator, and ENABLE_SIGNUP=false keeping the instance private with role-based access. Models are configured by adding OPENAI_API_KEY, ANTHROPIC_API_KEY, or any OpenAI-compatible base URL, with inference running on the provider side so the container stays light. Built-in RAG (document upload and retrieval), a tool runner, and model management are backed by the Postgres store.

Because the state that normally lives in a single container is externalized to Postgres and Redis, this deployment is both durable across redeploys and horizontally scalable — the production shape for team use rather than a single-user instance. PostgreSQL is the primary backup target.


Frequently Asked Questions

Why Postgres instead of the default SQLite? Open WebUI defaults to a single SQLite file, which is a single point of failure, harder to back up, and strained by concurrent users. This template wires PostgreSQL so a team's chats, users, and documents persist durably, back up cleanly, and handle many simultaneous writes.

What does Redis do here? It holds shared session, cache, and WebSocket state so Open WebUI can run as multiple instances without users being logged out or losing streaming responses. A default single-container deploy keeps that state in memory and can't scale past one instance.

Does my data persist and back up? Yes — all data lives in PostgreSQL, so it survives redeploys and backs up as a normal database dump, unlike a SQLite file inside a container. Postgres is the backup target.

Can I run more than one instance? Yes — that's why Redis is included. Shared session and WebSocket state let you run multiple replicas behind Railway's load balancing as your team's usage grows.


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 this Open WebUI stack on Railway you get the production shape of the most popular self-hosted AI chat UI — PostgreSQL for durable data that survives redeploys, Redis for scalable sessions, and authentication wired in. A private, team-ready ChatGPT alternative, self-hosted 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
116
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

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

codestorm
75