Architecture
Open WebUI provides the browser interface while Ollama or another compatible backend provides model inference. They may run on the same host or separate hosts. Size the inference host for the model; size the Open WebUI host for users, uploads and application services.
Data and secrets
Mount /app/backend/data to persistent storage. The official quick start also recommends a persistent WEBUI_SECRET_KEY for production. Losing either can disrupt sessions or application data.
Image version policy
The main image is convenient for evaluation. For production, select and test a specific release tag, document it and upgrade deliberately after reading release notes.
Public access checklist
Source
Confirm commands and environment variables in the official Open WebUI quick start before each upgrade.
系统结构
Open WebUI 提供浏览器界面,Ollama 或其他兼容后端负责模型推理。两者可以运行在同一主机,也可以分开部署。推理主机应按模型选择资源;Open WebUI 主机则按用户数量、上传文件和应用服务估算。
数据与密钥
必须将 /app/backend/data 挂载到持久化存储。官方快速入门还建议生产环境使用固定的 WEBUI_SECRET_KEY。丢失数据卷或密钥都可能影响会话与应用数据。
镜像版本策略
main 镜像适合快速体验。生产环境应选择并测试明确的发布标签,记录当前版本,并在阅读更新说明后有计划地升级。
公网访问检查
资料来源
每次升级前,请在 Open WebUI 官方快速入门 中确认当前命令和环境变量。
Deployment steps部署步骤
Prepare Docker and persistent storage准备 Docker 与持久化存储
Confirm Docker is available. A named volume keeps application data outside the container lifecycle.
确认 Docker 可用。命名数据卷可以让应用数据独立于容器生命周期。
docker --version
docker volume create open-webuiGenerate a stable application secret生成固定的应用密钥
Generate a long random value and store it in a root-readable environment file or secret manager. Reuse the same value after restarts and upgrades.
生成足够长的随机值,并保存到仅管理员可读的环境文件或密钥管理系统中。重启和升级后必须继续使用同一密钥。
openssl rand -hex 32Start Open WebUI启动 Open WebUI
This evaluation command persists data and lets the container reach an Ollama service on the host. Replace the example secret and pin a tested image tag for production.
该体验命令会持久化数据,并允许容器访问宿主机上的 Ollama。请替换示例密钥;生产环境应固定经过测试的镜像标签。
docker run -d -p 127.0.0.1:3001:8080 --add-host=host.docker.internal:host-gateway -e OLLAMA_BASE_URL=http://host.docker.internal:11434 -e WEBUI_SECRET_KEY='replace-with-a-long-random-value' -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:mainVerify the container验证容器状态
Check container health and logs locally before connecting a domain or opening a firewall rule.
绑定域名或开放防火墙规则前,先在本机检查容器状态和日志。
docker ps --filter name=open-webui
docker logs --tail=100 open-webui
curl -I http://127.0.0.1:3001Add Caddy and HTTPS配置 Caddy 与 HTTPS
Reverse proxy the local port through Caddy. Keep the container port private and confirm sign-up settings after creating the administrator.
通过 Caddy 反向代理本地端口,保持容器端口不直接对外,并在创建管理员后确认注册策略。
# openwebui.example.com {
# reverse_proxy 127.0.0.1:3001
# }