Make Ollama to Listen Any

Make ollama to listen on 0.0.0.0 instead of 127.0.0.1(default)

So that other hosts can talk to ollama

I installed ollama on lxc container, so I need to make my host machine or other container can use ollama running on the other container.

sudo systemctl edit ollama.service
  • Add following
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
sudo systemctl daemon-reload
sudo systemctl restart ollama
launchctl setenv OLLAMA_HOST "0.0.0.0:11434"