# How to Deploy Open WebUI as an LLM Frontend
Open WebUI is a self-hosted, ChatGPT-style interface for large language models. Point it at OpenAI-compatible APIs (OpenAI, local Ollama, or any compatible endpoint) and you get multi-user chat with history, roles, and document upload — fully under your control. This guide deploys it as a durable team service.
Persist data in Postgres, not the container
Open WebUI stores users, chats, settings, and uploaded documents. By default it uses a local SQLite database, which in a container is ephemeral — redeploy and you lose every account and conversation. For a real deployment, back it with PostgreSQL via a connection string. This is the single most important production setting.
Configure with environment variables
# Persist data in managed Postgres
DATABASE_URL=postgresql://user:pass@host:5432/openwebui
# Point at your LLM provider (OpenAI-compatible)
OPENAI_API_BASE_URL=https://api.openai.com/v1
OPENAI_API_KEY=<your-key>
# Or connect to a self-hosted Ollama
# OLLAMA_BASE_URL=http://ollama:11434
# Lock down sign-ups after creating your admin account
WEBUI_AUTH=true
ENABLE_SIGNUP=false
# Secret for signing sessions — set explicitly
WEBUI_SECRET_KEY=<random-secret>
PORT=8080Key points:
DATABASE_URLmakes users and chat history durable.ENABLE_SIGNUP=false(after you create the first admin) stops strangers from registering on your instance.WEBUI_SECRET_KEYkeeps sessions valid across redeploys.
Containerize
Open WebUI ships an official image:
FROM ghcr.io/open-webui/open-webui:main
EXPOSE 8080Pin a release tag instead of main in production for predictable upgrades.
Deploy on PandaStack
- 1Provision a managed PostgreSQL in the [dashboard](https://dashboard.pandastack.io). PandaStack auto-wires
DATABASE_URL— Open WebUI reads exactly that variable, so the persistence wiring is essentially automatic. - 2Create a container app from the Open WebUI image. It builds via rootless BuildKit and serves an HTTPS URL with automatic SSL.
- 3Set
OPENAI_API_KEY(and base URL),WEBUI_SECRET_KEY, and the signup/auth flags as encrypted env vars. - 4Open the URL, create your admin account, then set
ENABLE_SIGNUP=falseand redeploy to close registration.
Why this combo is clean
| Concern | Handled by |
|---|---|
| Durable users/chats | Managed Postgres (DATABASE_URL auto-wired) |
| HTTPS + custom domain | Automatic SSL, custom domains |
| Provider keys | Encrypted env vars |
| Backups | Scheduled + manual DB backups |
| Access control | Open WebUI roles + signup off |
Connecting your models
- Hosted APIs: set
OPENAI_API_BASE_URLandOPENAI_API_KEY. Anything OpenAI-compatible works, including many providers' compatibility endpoints. - Self-hosted Ollama: run Ollama as a separate container app and point
OLLAMA_BASE_URLat its internal address. Note that running LLMs yourself wants a memory-optimized tier and, for larger models, ideally a GPU.
Open WebUI is just the frontend — it's lightweight. The heavy compute lives in whatever model backend you connect, so size *that* appropriately and keep the WebUI itself on a modest tier.
Multi-user and teams
Open WebUI has built-in roles (admin/user) and per-user chat isolation. For a team deployment:
- Create accounts (or enable signup briefly, then disable it).
- Use the admin panel to manage models available to users.
- Because chats live in Postgres, they survive redeploys and are covered by backups.
Operational tips
- Cold starts: free-tier scale-to-zero means the first request after idle is slow. For a team that uses it all day, a paid tier keeps it warm; for occasional personal use, free is fine.
- Document upload / RAG: Open WebUI can do RAG over uploaded files; this increases memory and storage needs — watch metrics and scale the tier or DB storage as your library grows. Free-tier DBs are small (dev/hobby sized).
- Upgrades: pin the image tag, read the changelog before bumping, and rely on DB backups before a major upgrade.
Verify persistence
Create an account, have a chat, redeploy the app, and log back in. If your account and conversation are intact, DATABASE_URL is doing its job. That round-trip is the whole reason to self-host with a managed database.
References
- [Open WebUI documentation](https://docs.openwebui.com/)
- [Open WebUI: Environment variables](https://docs.openwebui.com/getting-started/env-configuration/)
- [Open WebUI GitHub](https://github.com/open-webui/open-webui)
- [Ollama](https://github.com/ollama/ollama)
Open WebUI gives your team a private ChatGPT-style frontend, and the only real work is durable storage and auth. PandaStack auto-wires the DATABASE_URL Open WebUI already expects and backs it with managed Postgres backups. Deploy it free at [dashboard.pandastack.io](https://dashboard.pandastack.io).