[GH-ISSUE #4540] "ollama is not running" issue after changing the host ip #80528

Closed
opened 2026-05-09 09:04:43 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @hknatm on GitHub (May 20, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4540

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

when first start everything is normal. After I change host address to 192.168.1.10:11434 from /etc/systemd/system/ollama.service by adding environment, I put "ollama pull [model]" it throws an error : "Error: could not connect to ollama app, is it running?" but when I curl that IP that I changed, it shows running and I can use it from my OpenWebUI with the new IP. If I erase that new host ip from config file and reboot the server I can pull new models (but host ip changes to localhost:11434). What is the issue with that, how to resolve it?

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.1.38

Originally created by @hknatm on GitHub (May 20, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4540 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? when first start everything is normal. After I change host address to 192.168.1.10:11434 from /etc/systemd/system/ollama.service by adding environment, I put "ollama pull [model]" it throws an error : "Error: could not connect to ollama app, is it running?" but when I curl that IP that I changed, it shows running and I can use it from my OpenWebUI with the new IP. If I erase that new host ip from config file and reboot the server I can pull new models (but host ip changes to localhost:11434). What is the issue with that, how to resolve it? ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.1.38
GiteaMirror added the bugneeds more info labels 2026-05-09 09:04:45 -05:00
Author
Owner

@dhiltgen commented on GitHub (May 21, 2024):

Can you clarify what you have OLLAMA_HOST set to on the client? By setting OLLAMA_HOST on the server to a specific IP address, it should only listen on that address, and the client will not be able to access it over localhost (127.0.0.1) but must use the same IP address the server is listening to. Another possible server setup is 0.0.0.0:11434, which will tell the server to bind to all interfaces (including localhost), but you should be careful about exposing ollama to untrusted users/networks.

<!-- gh-comment-id:2123376560 --> @dhiltgen commented on GitHub (May 21, 2024): Can you clarify what you have OLLAMA_HOST set to on the client? By setting OLLAMA_HOST on the server to a specific IP address, it should only listen on that address, and the client will not be able to access it over localhost (127.0.0.1) but must use the same IP address the server is listening to. Another possible server setup is 0.0.0.0:11434, which will tell the server to bind to all interfaces (including localhost), but you should be careful about exposing ollama to untrusted users/networks.
Author
Owner

@hknatm commented on GitHub (May 21, 2024):

OLLAMA_HOST=192.168.1.10:11434 (mylocal network subnet) I can use it, reach it from openwebui with this ip.
The problem with that is when I try to pull new model from cli on the server (same ip, the server ollama runs on), It gives that error. When I change OLLAMA_HOST back to localhost ip it pulls the model.
I want to use it specifically on that ip. Is that a bug or config file mistake that I am doing?

<!-- gh-comment-id:2123601690 --> @hknatm commented on GitHub (May 21, 2024): OLLAMA_HOST=192.168.1.10:11434 (mylocal network subnet) I can use it, reach it from openwebui with this ip. The problem with that is when I try to pull new model from cli on the server (same ip, the server ollama runs on), It gives that error. When I change OLLAMA_HOST back to localhost ip it pulls the model. I want to use it specifically on that ip. Is that a bug or config file mistake that I am doing?
Author
Owner

@ghost commented on GitHub (May 22, 2024):

Same error when setting 0.0.0.0 as OLLAMA_HOST.

systemctl logs show that it is listening on the configured IP but running ollama list shows the error.

ollama list works without error when there is no OLLAMA_HOST set in the systemctl service file. version 0.1.38

<!-- gh-comment-id:2123741061 --> @ghost commented on GitHub (May 22, 2024): Same error when setting 0.0.0.0 as OLLAMA_HOST. systemctl logs show that it is listening on the configured IP but running ollama list shows the error. ollama list works without error when there is no OLLAMA_HOST set in the systemctl service file. version 0.1.38
Author
Owner

@dhiltgen commented on GitHub (Jul 3, 2024):

@hknatm I haven't been able to reproduce your failure. I think your OLLAMA_HOST values aren't set correctly in the client and server.

In one terminal

% export OLLAMA_HOST=10.16.0.127:11434
% ollama serve
2024/07/03 15:57:41 routes.go:1077: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_HOST:http://10.16.0.127:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE: OLLAMA_LLM_LIBRARY: OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MAX_VRAM:0 OLLAMA_MODELS:/home/daniel/.ollama/models OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://*] OLLAMA_RUNNERS_DIR: OLLAMA_SCHED_SPREAD:false OLLAMA_TMPDIR: ROCR_VISIBLE_DEVICES:]"
time=2024-07-03T15:57:41.500-07:00 level=INFO source=images.go:751 msg="total blobs: 66"
time=2024-07-03T15:57:41.501-07:00 level=INFO source=images.go:758 msg="total unused blobs removed: 0"
time=2024-07-03T15:57:41.501-07:00 level=INFO source=routes.go:1124 msg="Listening on 10.16.0.127:11434 (version 0.1.49-rc3-10-g3c75113)"
...

(notice the listening line matches the IP)

In another terminal:

% export OLLAMA_HOST=10.16.0.127:11434
% ollama pull gemma2
pulling manifest
...

From what you're describing, I think you forgot to set the OLLAMA_HOST in the terminal where you're running ollama pull which means it is defaulting to 127.0.0.1:11434, but your server is NOT listening on localhost, it's listening on your designated IP.

@OpenCoderX I'm not following your scenario. For the server, setting 0.0.0.0 will bind to ALL addresses on the host, not a single address.

In one terminal:

% export OLLAMA_HOST=0.0.0.0:11434
% ollama serve
2024/07/03 16:04:43 routes.go:1077: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_HOST:http://0.0.0.0:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE: OLLAMA_LLM_LIBRARY: OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MAX_VRAM:0 OLLAMA_MODELS:/home/daniel/.ollama/models OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://*] OLLAMA_RUNNERS_DIR: OLLAMA_SCHED_SPREAD:false OLLAMA_TMPDIR: ROCR_VISIBLE_DEVICES:]"
time=2024-07-03T16:04:43.804-07:00 level=INFO source=images.go:751 msg="total blobs: 69"
time=2024-07-03T16:04:43.805-07:00 level=INFO source=images.go:758 msg="total unused blobs removed: 0"
time=2024-07-03T16:04:43.806-07:00 level=INFO source=routes.go:1124 msg="Listening on [::]:11434 (version 0.1.49-rc3-10-g3c75113)"
...

(Notice the listening line does not specify an IP, but just the port - the [::] indicates it is listening on all addresses.

In another terminal

% unset OLLAMA_HOST
% ollama pull gemma2
pulling manifest
...

(this works against localhost, since the server is listening on that address too)

<!-- gh-comment-id:2207446210 --> @dhiltgen commented on GitHub (Jul 3, 2024): @hknatm I haven't been able to reproduce your failure. I think your OLLAMA_HOST values aren't set correctly in the client and server. In one terminal ``` % export OLLAMA_HOST=10.16.0.127:11434 % ollama serve 2024/07/03 15:57:41 routes.go:1077: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_HOST:http://10.16.0.127:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE: OLLAMA_LLM_LIBRARY: OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MAX_VRAM:0 OLLAMA_MODELS:/home/daniel/.ollama/models OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://*] OLLAMA_RUNNERS_DIR: OLLAMA_SCHED_SPREAD:false OLLAMA_TMPDIR: ROCR_VISIBLE_DEVICES:]" time=2024-07-03T15:57:41.500-07:00 level=INFO source=images.go:751 msg="total blobs: 66" time=2024-07-03T15:57:41.501-07:00 level=INFO source=images.go:758 msg="total unused blobs removed: 0" time=2024-07-03T15:57:41.501-07:00 level=INFO source=routes.go:1124 msg="Listening on 10.16.0.127:11434 (version 0.1.49-rc3-10-g3c75113)" ... ``` (notice the listening line matches the IP) In another terminal: ``` % export OLLAMA_HOST=10.16.0.127:11434 % ollama pull gemma2 pulling manifest ... ``` From what you're describing, I think you forgot to set the OLLAMA_HOST in the terminal where you're running `ollama pull` which means it is defaulting to 127.0.0.1:11434, but your server is NOT listening on localhost, it's listening on your designated IP. @OpenCoderX I'm not following your scenario. For the server, setting 0.0.0.0 will bind to ALL addresses on the host, not a single address. In one terminal: ``` % export OLLAMA_HOST=0.0.0.0:11434 % ollama serve 2024/07/03 16:04:43 routes.go:1077: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_HOST:http://0.0.0.0:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE: OLLAMA_LLM_LIBRARY: OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MAX_VRAM:0 OLLAMA_MODELS:/home/daniel/.ollama/models OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://*] OLLAMA_RUNNERS_DIR: OLLAMA_SCHED_SPREAD:false OLLAMA_TMPDIR: ROCR_VISIBLE_DEVICES:]" time=2024-07-03T16:04:43.804-07:00 level=INFO source=images.go:751 msg="total blobs: 69" time=2024-07-03T16:04:43.805-07:00 level=INFO source=images.go:758 msg="total unused blobs removed: 0" time=2024-07-03T16:04:43.806-07:00 level=INFO source=routes.go:1124 msg="Listening on [::]:11434 (version 0.1.49-rc3-10-g3c75113)" ... ``` (Notice the listening line does not specify an IP, but just the port - the `[::]` indicates it is listening on all addresses. In another terminal ``` % unset OLLAMA_HOST % ollama pull gemma2 pulling manifest ... ``` (this works against localhost, since the server is listening on that address too)
Author
Owner

@S-Azimi commented on GitHub (Jan 6, 2025):

I have the same issue. it works on localhost but when changing the localhost to a local ip address,
sudo netstat -tuln | grep 11434

shows that it listens to the local ip, but it does there is no response on post requests.

<!-- gh-comment-id:2573288262 --> @S-Azimi commented on GitHub (Jan 6, 2025): I have the same issue. it works on localhost but when changing the localhost to a local ip address, sudo netstat -tuln | grep 11434 shows that it listens to the local ip, but it does there is no response on post requests.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#80528