OpenWebUI连接不上Ollama模型,Ubuntu24.04

这里写自定义目录标题

问题介绍

  • 操作系统 Ubuntu24.04
  • Ollama 使用默认安装方法(官网https://github.com/ollama/ollama) curl -fsSL https://ollama.com/install.sh | sh 安装在本机
  • OpenWebUI
    使用默认docker安装方法(官网教程安装https://docs.openwebui.com/) docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main 安装在docker

  • 使用 http://127.0.0.1:11434/ 访问Ollama显示Ollama is running,说明Ollama正常。

  • Ollama中安装了模型,并且可以命令行形式使用。

  • 使用http://localhost:8080/登录OpenWebUI后发现没有模型

解决方法

  1. 在OpenWebUI管理面板中,管理Ollama API连接 默认为http://host.docker.internal:11434/,这是windows中的方式,需要改为http://127.0.0.1:11434
  2. 在 访问 Ollama 时遇到问题? 点击这里获取帮助。点击导航到https://github.com/open-webui/open-webui#troubleshooting,根据教程Open WebUI: Server Connection Error
    If you’re experiencing connection issues, it’s often due to the WebUI docker container not being able to reach the Ollama server at 127.0.0.1:11434 (host.docker.internal:11434) inside the container . Use the --network=host flag in your docker command to resolve this. Note that the port changes from 3000 to 8080, resulting in the link: http://localhost:8080.
docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main

删除docker,并使用上面的命令重新创建docker,使用http://localhost:8080访问OpenWebUI即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值