[GH-ISSUE #5574] Changing ollama service port will break ollama commandline #49996

Closed
opened 2026-04-28 13:43:39 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @raymond-infinitecode on GitHub (Jul 9, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5574

What is the issue?

Step to reproduce:
systemctl edit ollama.service

[Service]
Environment="OLLAMA_HOST=0.0.0.0:8080"

Ctrl + X save, exit nano editor

ollama list
Error: could not connect to ollama app. is it running ?

After changing the port back to 0.0.0.0:11434, it works.

OS

Linux

GPU

Other

CPU

Intel

Ollama version

0.1.41

Originally created by @raymond-infinitecode on GitHub (Jul 9, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5574 ### What is the issue? Step to reproduce: systemctl edit ollama.service [Service] Environment="OLLAMA_HOST=0.0.0.0:8080" Ctrl + X save, exit nano editor ollama list Error: could not connect to ollama app. is it running ? After changing the port back to 0.0.0.0:11434, it works. ### OS Linux ### GPU Other ### CPU Intel ### Ollama version 0.1.41
GiteaMirror added the bug label 2026-04-28 13:43:39 -05:00
Author
Owner

@raymond-infinitecode commented on GitHub (Jul 9, 2024):

Expectation, ollama command to connect to the correct port once change the service.
or allow to configure ollama to point to the correct port

<!-- gh-comment-id:2217936525 --> @raymond-infinitecode commented on GitHub (Jul 9, 2024): Expectation, ollama command to connect to the correct port once change the service. or allow to configure ollama to point to the correct port
Author
Owner

@pdevine commented on GitHub (Jul 9, 2024):

You can just call it with: OLLAMA_HOST=localhost:8080 ollama list

<!-- gh-comment-id:2218118985 --> @pdevine commented on GitHub (Jul 9, 2024): You can just call it with: `OLLAMA_HOST=localhost:8080 ollama list`
Author
Owner

@raymond-infinitecode commented on GitHub (Jul 10, 2024):

Thanks !

<!-- gh-comment-id:2219533295 --> @raymond-infinitecode commented on GitHub (Jul 10, 2024): Thanks !
Author
Owner

@huoyalong commented on GitHub (Jul 28, 2024):

谢谢!

老哥,请教一下怎么实现自定义端口启动ollama,Linxu中应该怎么配置呀
这一句在哪配置
OLLAMA_HOST=localhost:8080 ollama list

<!-- gh-comment-id:2254492158 --> @huoyalong commented on GitHub (Jul 28, 2024): > 谢谢! 老哥,请教一下怎么实现自定义端口启动ollama,Linxu中应该怎么配置呀 这一句在哪配置 OLLAMA_HOST=localhost:8080 ollama list
Author
Owner

@raymond-infinitecode commented on GitHub (Jul 30, 2024):

vi ~/.bashrc
export OLLAMA_HOST="localhost:8080"

save the file wq

exit terminal, login again.

sudo systemctl edit ollama.service
...
[Service]
...
Environment="OLLAMA_HOST=0.0.0.0:8080"
...
ctrl x

sudo systemctl restart ollama.service

<!-- gh-comment-id:2258146355 --> @raymond-infinitecode commented on GitHub (Jul 30, 2024): vi ~/.bashrc export OLLAMA_HOST="localhost:8080" save the file wq exit terminal, login again. sudo systemctl edit ollama.service ... [Service] ... Environment="OLLAMA_HOST=0.0.0.0:8080" ... ctrl x sudo systemctl restart ollama.service
Author
Owner

@huoyalong commented on GitHub (Jul 30, 2024):

vi ~/.bashrc export OLLAMA_HOST="localhost:8080"

save the file wq

exit terminal, login again.

sudo systemctl edit ollama.service ... [Service] ... Environment="OLLAMA_HOST=0.0.0.0:8080" ... ctrl x

sudo systemctl restart ollama.service
我这两天已经研究明白了哈哈哈, 不过还是灰常感谢 !!

<!-- gh-comment-id:2258584185 --> @huoyalong commented on GitHub (Jul 30, 2024): > vi ~/.bashrc export OLLAMA_HOST="localhost:8080" > > save the file wq > > exit terminal, login again. > > sudo systemctl edit ollama.service ... [Service] ... Environment="OLLAMA_HOST=0.0.0.0:8080" ... ctrl x > > sudo systemctl restart ollama.service 我这两天已经研究明白了哈哈哈, 不过还是灰常感谢 !!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#49996