[GH-ISSUE #7331] launchctl setenv OLLAMA_HOST "0.0.0.0" does not work in version 0.3.14 #4658

Closed
opened 2026-04-12 15:34:38 -05:00 by GiteaMirror · 9 comments
Owner

Originally created by @wuweinero on GitHub (Oct 23, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7331

What is the issue?

launchctl setenv OLLAMA_HOST "0.0.0.0" does not work in version 0.3.14. It still listens to 127.0.0.1

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.3.14

Originally created by @wuweinero on GitHub (Oct 23, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7331 ### What is the issue? launchctl setenv OLLAMA_HOST "0.0.0.0" does not work in version 0.3.14. It still listens to 127.0.0.1 ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.3.14
GiteaMirror added the bug label 2026-04-12 15:34:38 -05:00
Author
Owner

@wuweinero commented on GitHub (Oct 23, 2024):

Version 0.3.11 works well.

<!-- gh-comment-id:2431966985 --> @wuweinero commented on GitHub (Oct 23, 2024): Version 0.3.11 works well.
Author
Owner

@kd4pba commented on GitHub (Oct 28, 2024):

Same issue, no matter what is in the file it reverts to localhost only.

/etc/systemd/system/ollama.service.d/override.conf:1: Assignment outside of section. Ignoring.

<!-- gh-comment-id:2441822732 --> @kd4pba commented on GitHub (Oct 28, 2024): Same issue, no matter what is in the file it reverts to localhost only. /etc/systemd/system/ollama.service.d/override.conf:1: Assignment outside of section. Ignoring.
Author
Owner

@fdstevex commented on GitHub (Dec 20, 2024):

There doesn't seem to be an obvious way to get ollama running as a service to listen on all interfaces on macOS Sequoia. launchctl setenv OLLAMA_HOST "0.0.0.0" doesn't work.

What does work is going to /opt/homebrew/Cellar/ollama/0.6.0 or whatever the current version is, and editing the homebrew.mxcl.ollama.plist to include:

    <key>EnvironmentVariables</key>
    <dict>
        <key>OLLAMA_HOST</key>
        <string>0.0.0.0</string>
    </dict>

Then do a brew services restart ollama.

But this isn't a great solution.

<!-- gh-comment-id:2557116501 --> @fdstevex commented on GitHub (Dec 20, 2024): There doesn't seem to be an obvious way to get ollama running as a service to listen on all interfaces on macOS Sequoia. `launchctl setenv OLLAMA_HOST "0.0.0.0"` doesn't work. What does work is going to `/opt/homebrew/Cellar/ollama/0.6.0` or whatever the current version is, and editing the `homebrew.mxcl.ollama.plist` to include: ``` <key>EnvironmentVariables</key> <dict> <key>OLLAMA_HOST</key> <string>0.0.0.0</string> </dict> ``` Then do a `brew services restart ollama`. But this isn't a great solution.
Author
Owner

@OKHand-Zy commented on GitHub (Jan 3, 2025):

I'm having the same issue. Has anyone solved it?
macOS : Sonoma 14.6.1
Ollama Version:0.5.4

<!-- gh-comment-id:2568630591 --> @OKHand-Zy commented on GitHub (Jan 3, 2025): I'm having the same issue. Has anyone solved it? macOS : Sonoma 14.6.1 Ollama Version:0.5.4
Author
Owner

@PeteHaughie commented on GitHub (Jan 6, 2025):

There doesn't seem to be an obvious way to get ollama running as a service to listen on all interfaces on macOS Sequoia. launchctl setenv OLLAMA_HOST "0.0.0.0" doesn't work.

What does work is going to /opt/homebrew/ollama/0.5.4 or whatever the current version is, and editing the homebrew.mxcl.ollama.plist to include:

    <key>EnvironmentVariables</key>
    <dict>
        <key>OLLAMA_HOST</key>
        <string>0.0.0.0</string>
    </dict>

Then do a brew services restart ollama.

But this isn't a great solution.

Literally the only thing that worked for me after hours of poking at it

<!-- gh-comment-id:2571986381 --> @PeteHaughie commented on GitHub (Jan 6, 2025): > There doesn't seem to be an obvious way to get ollama running as a service to listen on all interfaces on macOS Sequoia. `launchctl setenv OLLAMA_HOST "0.0.0.0"` doesn't work. > > What does work is going to `/opt/homebrew/ollama/0.5.4` or whatever the current version is, and editing the `homebrew.mxcl.ollama.plist` to include: > > ``` > <key>EnvironmentVariables</key> > <dict> > <key>OLLAMA_HOST</key> > <string>0.0.0.0</string> > </dict> > ``` > > Then do a `brew services restart ollama`. > > But this isn't a great solution. Literally the only thing that worked for me after hours of poking at it
Author
Owner

@tianqizhao-louis commented on GitHub (Jan 6, 2025):

I think you have to do OLLAMA_HOST=0.0.0.0 ollama serve right now.

<!-- gh-comment-id:2573936668 --> @tianqizhao-louis commented on GitHub (Jan 6, 2025): I think you have to do `OLLAMA_HOST=0.0.0.0 ollama serve` right now.
Author
Owner

@johnsaigle commented on GitHub (Apr 27, 2025):

Same issue on macOS 15.3.2 and ollama version 0.6.6. The plist modifications worked for me.

<!-- gh-comment-id:2833576201 --> @johnsaigle commented on GitHub (Apr 27, 2025): Same issue on macOS 15.3.2 and ollama version 0.6.6. The plist modifications worked for me.
Author
Owner

@dhiltgen commented on GitHub (Jul 4, 2025):

The latest version of the Mac app include a configuration screen now to simplify exposing ollama on the local network.

Image
<!-- gh-comment-id:3037207790 --> @dhiltgen commented on GitHub (Jul 4, 2025): The latest version of the Mac app include a configuration screen now to simplify exposing ollama on the local network. <img width="615" height="388" alt="Image" src="https://github.com/user-attachments/assets/3ad69ed6-27bb-43a7-b0e3-c2dc0429b0c7" />
Author
Owner

@Elusv commented on GitHub (Feb 10, 2026):

OLLAMA_HOST=0.0.0.0 ollama serve

This is the (better) answer (from tianqizhao-louis). This also allows you to set other variables such as:
OLLAMA_CONTEXT_LENGTH=64000 OLLAMA_HOST=0.0.0.0:11434 ollama serve

(which i made an alias so I don't have to remember it :-)

<!-- gh-comment-id:3880112751 --> @Elusv commented on GitHub (Feb 10, 2026): > OLLAMA_HOST=0.0.0.0 ollama serve This is the (better) answer (from tianqizhao-louis). This also allows you to set other variables such as: OLLAMA_CONTEXT_LENGTH=64000 OLLAMA_HOST=0.0.0.0:11434 ollama serve (which i made an alias so I don't have to remember it :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#4658