参考文档
本地部署
- 连接本地 Ollama 服务:
使用 Docker Compose 封装运行。
修改 Ollama 配置:宿主机 Ollama 服务地址为 http://host.docker.internal:11434。
查看本地模型 ID:
管理员面板 / 设置 / 外部连接:
运行页面:
修改配置文件:由于本地已经运行了 Ollama 服务,所以需要修改 docker-compose.yaml 以及.env 文件中关于 Ollama 的配置。
cd open-webui
cp .env.example .env
# .env
# Ollama URL for the backend to connect The path '/ollama' will be redirected to the specified # backend URL
OLLAMA_BASE_URL='http://host.docker.internal:11434'
# AUTOMATIC1111_BASE_URL="http://localhost:7860"
# For production, you should only need one host as # fastapi serves the svelte-kit built frontend and backend from the same host and port.
# To test with CORS locally, you can set something like
# CORS_ALLOW_ORIGIN='http://localhost:5173;http://localhost:8080'
CORS_ALLOW_ORIGIN='*'
# For production you should set this to match the proxy configuration (127.0.0.1)
FORWARDED_ALLOW_IPS='*'
# DO NOT TRACK SCARF_NO_ANALYTICS=true
DO_NOT_TRACK=true
ANONYMIZED_TELEMETRY=false
# docker-compose.yml
services:
open-webui:
build:
context: .
dockerfile: Dockerfile
image: ghcr.io/open-webui/open-webui:${WEBUI_Docker_TAG-main}
container_name: open-webui
{}
{}


