I’ve recently install Ollama on my MacBook and need it listen on all network interfaces. The default installation view Homebrew brings a service description for home-brew. And the default behaviour of Ollama is to listen only on localhost
. I need to add an environment variable to the Ollama command to make it listen on all interfaces.
The service description for the home brew formulae of Ollama can be found in /opt/homebrew/opt/ollama/homebrew.mxcl.ollama.plist
I search for documentation of this file but could not easily find one. Eventually I had to turn to ChatGPT and that gave me the correct solution.
I needed to add the following structure to the .plist
file:
<key>EnvironmentVariables</key>
<dict>
<key>OLLAMA_HOST</key>
<string>0.0.0.0</string>
</dict>
Then after a restart via brew services restart ollama
the service was finally listening on all interfaces.