[GH-ISSUE #10325] running ollama CLI client on a server and backend on another server #68837

Closed
opened 2026-05-04 15:23:02 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @AlbertoSinigaglia on GitHub (Apr 17, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10325

I have 2 servers, one in which I would like to run ollama (the "backend") and another from which i'd love to control that other server.

I've successfully connected the two using autossh, and if I run OLLAMA_HOST="localhost:6000" ollama list it works with no problem. However, also OLLAMA_HOST="localhost:11434" ollama list works fine, because the backend is also working on the "client" server.

Is there a way to just have the CLI on a server, and the rest in the other one?

I have already tried to do

sudo -E systemctl edit ollama.service

 > Environment="OLLAMA_HOST=0.0.0.0:6000"

sudo systemctl restart ollama

however, it doesn't quite work:

sudo journalctl -u ollama --no-pager --since=today
 > apr 17 23:45:38 acquario3 ollama[3456552]: Error: listen tcp 0.0.0.0:6000: bind: address already in use
 > apr 17 23:45:38 acquario3 systemd[1]: ollama.service: Main process exited, code=exited, status=1/FAILURE
 > apr 17 23:45:38 acquario3 systemd[1]: ollama.service: Failed with result 'exit-code'.

and:

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

any idea?

Originally created by @AlbertoSinigaglia on GitHub (Apr 17, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10325 I have 2 servers, one in which I would like to run ollama (the "backend") and another from which i'd love to control that other server. I've successfully connected the two using `autossh`, and if I run `OLLAMA_HOST="localhost:6000" ollama list` it works with no problem. However, also `OLLAMA_HOST="localhost:11434" ollama list` works fine, because the backend is also working on the "client" server. Is there a way to just have the CLI on a server, and the rest in the other one? I have already tried to do ``` sudo -E systemctl edit ollama.service > Environment="OLLAMA_HOST=0.0.0.0:6000" sudo systemctl restart ollama ``` however, it doesn't quite work: ``` sudo journalctl -u ollama --no-pager --since=today > apr 17 23:45:38 acquario3 ollama[3456552]: Error: listen tcp 0.0.0.0:6000: bind: address already in use > apr 17 23:45:38 acquario3 systemd[1]: ollama.service: Main process exited, code=exited, status=1/FAILURE > apr 17 23:45:38 acquario3 systemd[1]: ollama.service: Failed with result 'exit-code'. ``` and: ``` $ ollama list Error: could not connect to ollama app, is it running? ``` any idea?
GiteaMirror added the feature request label 2026-05-04 15:23:02 -05:00
Author
Owner

@AlbertoSinigaglia commented on GitHub (Apr 17, 2025):

maybe I just need to export the var, since echo prints nothing:

echo $OLLAMA_HOST
 > 

and I don't see any process runnign as ollama:

ps aux | grep ollama
alberto+ 3458196  0.0  0.0   9216  2048 pts/8    S+   23:50   0:00 grep --color=auto ollama
<!-- gh-comment-id:2814089988 --> @AlbertoSinigaglia commented on GitHub (Apr 17, 2025): maybe I just need to export the var, since echo prints nothing: ``` echo $OLLAMA_HOST > ``` and I don't see any process runnign as ollama: ``` ps aux | grep ollama alberto+ 3458196 0.0 0.0 9216 2048 pts/8 S+ 23:50 0:00 grep --color=auto ollama ```
Author
Owner

@AlbertoSinigaglia commented on GitHub (Apr 17, 2025):

Eheh sudo nano /etc/environment was more than enough to do the trick

<!-- gh-comment-id:2814092622 --> @AlbertoSinigaglia commented on GitHub (Apr 17, 2025): Eheh `sudo nano /etc/environment` was more than enough to do the trick
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#68837