[GH-ISSUE #739] Add ability to listen on unix socket #62385

Open
opened 2026-05-03 08:44:06 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @shtrophic on GitHub (Oct 9, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/739

For usecases when there is a reverse-proxy in front of ollama, it would make sense to enable listening on a unix socket instead of a port, that is /path/to.socket. This would reduce unnecessary TCP/IP-overhead between reverse proxy and ollama, as well as enable security configurations with unix file permissions.

Originally created by @shtrophic on GitHub (Oct 9, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/739 For usecases when there is a reverse-proxy in front of ollama, it would make sense to enable listening on a unix socket instead of a port, that is `/path/to.socket`. This would reduce unnecessary TCP/IP-overhead between reverse proxy and ollama, as well as enable security configurations with unix file permissions.
GiteaMirror added the feature request label 2026-05-03 08:44:07 -05:00
Author
Owner

@jmorganca commented on GitHub (Oct 9, 2023):

Thanks for the issue!

<!-- gh-comment-id:1753690219 --> @jmorganca commented on GitHub (Oct 9, 2023): Thanks for the issue!
Author
Owner

@Stebalien commented on GitHub (Dec 22, 2023):

So, I'm looking into implementing this (if that's OK). My plan was to reuse the OLLAMA_HOST variable but model it after DOCKER_HOST:

  • Keep support for IP:PORT and IP.
  • Add support for tcp://IP:PORT.
  • Add support for unix:///path/to/socket.

Thoughts?

(eventually I'd like to add systemd socket activation)

<!-- gh-comment-id:1867901386 --> @Stebalien commented on GitHub (Dec 22, 2023): So, I'm looking into implementing this (if that's OK). My plan was to reuse the `OLLAMA_HOST` variable but model it after `DOCKER_HOST`: - Keep support for `IP:PORT` and `IP`. - Add support for `tcp://IP:PORT`. - Add support for `unix:///path/to/socket`. Thoughts? (eventually I'd like to add systemd socket activation)
Author
Owner

@nathaniel-brough commented on GitHub (Feb 14, 2024):

@Stebalien how are you getting on with this, I'm also interested and potentially can justify putting some time towards it if you need some help?

<!-- gh-comment-id:1944517892 --> @nathaniel-brough commented on GitHub (Feb 14, 2024): @Stebalien how are you getting on with this, I'm also interested and potentially can justify putting some time towards it if you need some help?
Author
Owner

@Stebalien commented on GitHub (Feb 14, 2024):

I was waiting for feedback but missed the 👍. I have no plans to tackle it immediately (I'll wait till I get a free weekend) so go for it.

<!-- gh-comment-id:1944542082 --> @Stebalien commented on GitHub (Feb 14, 2024): I was waiting for feedback but missed the :+1:. I have no plans to tackle it immediately (I'll wait till I get a free weekend) so go for it.
Author
Owner

@RangerMauve commented on GitHub (May 7, 2024):

This'd be nice to have. I was thinking it'd be useful in combination with some sort of listener from systemd to start the server on-demand.

<!-- gh-comment-id:2099377743 --> @RangerMauve commented on GitHub (May 7, 2024): This'd be nice to have. I was thinking it'd be useful in combination with some sort of listener from systemd to start the server on-demand.
Author
Owner

@fvillena commented on GitHub (Jun 7, 2024):

It would be helpful for security concerns on multi-user machines.

<!-- gh-comment-id:2153724941 --> @fvillena commented on GitHub (Jun 7, 2024): It would be helpful for security concerns on multi-user machines.
Author
Owner

@hoodiecollin commented on GitHub (Aug 22, 2024):

Any updates on this?

<!-- gh-comment-id:2305851632 --> @hoodiecollin commented on GitHub (Aug 22, 2024): Any updates on this?
Author
Owner

@doringeman commented on GitHub (Dec 12, 2024):

Hello! I gave it a go in https://github.com/ollama/ollama/pull/8072.

<!-- gh-comment-id:2539420522 --> @doringeman commented on GitHub (Dec 12, 2024): Hello! I gave it a go in https://github.com/ollama/ollama/pull/8072.
Author
Owner

@googol commented on GitHub (May 24, 2025):

As an extension to this, supporting systemd socket activation would be nice (https://0pointer.de/blog/projects/socket-activation.html)

<!-- gh-comment-id:2906970795 --> @googol commented on GitHub (May 24, 2025): As an extension to this, supporting systemd socket activation would be nice (https://0pointer.de/blog/projects/socket-activation.html)
Author
Owner

@ppetr commented on GitHub (Apr 24, 2026):

Yes please, I'm also looking for systemd socket activation!

<!-- gh-comment-id:4312630991 --> @ppetr commented on GitHub (Apr 24, 2026): Yes please, I'm also looking for `systemd` socket activation!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#62385