[GH-ISSUE #8297] ollama should use /usr/local to store models in Linux #5312

Open
opened 2026-04-12 16:30:14 -05:00 by GiteaMirror · 12 comments
Owner

Originally created by @renich on GitHub (Jan 3, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8297

What is the issue?

Hello,

right now, ollama is using /usr/share/ollama as it's path to store models and other things when running at a system level (with systemd).

If you care for the FHS: https://refspecs.linuxfoundation.org/FHS_3.0/index.html, you should put it in /usr/local/ollama as a default. Why? Because /usr is for the system to manage. Stuff that comes from the system's repos.

In this case, ollama is external.

Alternatively (not my taste), you could use /opt/ollama to store everything ollama related. I'd much rather you adhere to the FHS.

And, that said, I started a conversation in the Fedora forums about where should models live in a system: https://discussion.fedoraproject.org/t/where-do-we-put-models-if-we-take-into-account-the-fhs/141302

Definitely not /var if you ask me since they're not variable.

In any case, feel free to join the conversation.

OS

Linux

GPU

AMD

CPU

AMD

Ollama version

0.5.4

Originally created by @renich on GitHub (Jan 3, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8297 ### What is the issue? Hello, right now, ollama is using `/usr/share/ollama` as it's path to store models and other things when running at a system level (with systemd). If you care for the FHS: https://refspecs.linuxfoundation.org/FHS_3.0/index.html, you should put it in `/usr/local/ollama` as a default. Why? Because /usr is for the system to manage. Stuff that comes from the system's repos. In this case, ollama is external. Alternatively (not my taste), you could use `/opt/ollama` to store everything ollama related. I'd much rather you adhere to the FHS. And, that said, I started a conversation in the Fedora forums about where should models live in a system: https://discussion.fedoraproject.org/t/where-do-we-put-models-if-we-take-into-account-the-fhs/141302 Definitely not `/var` if you ask me since they're not variable. In any case, feel free to join the conversation. ### OS Linux ### GPU AMD ### CPU AMD ### Ollama version 0.5.4
GiteaMirror added the bug label 2026-04-12 16:30:14 -05:00
Author
Owner

@Prakhar29Sharma commented on GitHub (Jan 7, 2025):

Hi @renich! I'm certainly new to open source and would love to help fix this issue. Whether it's code or documentation, I'm eager to contribute. Any guidance on how to get started would be appreciated. Thanks!

<!-- gh-comment-id:2574495494 --> @Prakhar29Sharma commented on GitHub (Jan 7, 2025): Hi @renich! I'm certainly new to open source and would love to help fix this issue. Whether it's code or documentation, I'm eager to contribute. Any guidance on how to get started would be appreciated. Thanks!
Author
Owner

@renich commented on GitHub (Jan 7, 2025):

Hi @renich! I'm certainly new to open source and would love to help fix this issue. Whether it's code or documentation, I'm eager to contribute. Any guidance on how to get started would be appreciated. Thanks!

Hey Prakhar295harma, I am not a member of the project. That said, here're my two cents:

This should be, first, acknowledged and discussed with the project team. If they agree to my reasoning and wish to proceed and change it, it should be some env variable or constant somewhere in the code. Find it.

What one usually does, in my own experience is:

  • clone the project.
  • make the change.
  • create a pull request fully explaining what it does and referencing the bug in question (so that it gets fixed when merged (you can say something like: fixes bug #29387928l)).
  • discuss the change in the pull request.
  • have them merge it or close it.

Yet, it's always better to find a chat channel where the team gathers and discuss it there first.

Like I said, I'm not part of the project so take my advice with a grain of salt.

<!-- gh-comment-id:2575871130 --> @renich commented on GitHub (Jan 7, 2025): > Hi @renich! I'm certainly new to open source and would love to help fix this issue. Whether it's code or documentation, I'm eager to contribute. Any guidance on how to get started would be appreciated. Thanks! Hey Prakhar295harma, I am not a member of the project. That said, here're my two cents: This should be, first, acknowledged and discussed with the project team. If they agree to my reasoning and wish to proceed and change it, it should be some env variable or constant somewhere in the code. Find it. What one usually does, in my own experience is: * clone the project. * make the change. * create a pull request fully explaining what it does and referencing the bug in question (so that it gets fixed when merged (you can say something like: fixes bug #29387928l)). * discuss the change in the pull request. * have them merge it or close it. Yet, it's always better to find a chat channel where the team gathers and discuss it there first. Like I said, I'm not part of the project so take my advice with a grain of salt.
Author
Owner

@Prakhar29Sharma commented on GitHub (Jan 7, 2025):

No worries, thanks for the guidance @renich!

<!-- gh-comment-id:2575903394 --> @Prakhar29Sharma commented on GitHub (Jan 7, 2025): No worries, thanks for the guidance @renich!
Author
Owner

@rick-github commented on GitHub (Jan 8, 2025):

The binary and libraries are currently installed in /usr/local/{bin,lib} if available. The model data, history and ssh keys are stored in the home directory of the ollama user, /usr/share/ollama. As a historical note, the home directory was moved from /home/ollama to /usr/share/ollama in cbc40aa996. If you change that to /usr/local/share/ollama you will need to consider the implications of an upgrade moving potentially many gigabytes of models to a new directory.

<!-- gh-comment-id:2577928667 --> @rick-github commented on GitHub (Jan 8, 2025): The binary and libraries are currently installed in `/usr/local/{bin,lib}` if available. The model data, history and ssh keys are stored in the home directory of the ollama user, `/usr/share/ollama`. As a historical note, the home directory was moved from `/home/ollama` to `/usr/share/ollama` in cbc40aa9967d27a58f87442018f2d889782d1980. If you change that to `/usr/local/share/ollama` you will need to consider the implications of an upgrade moving potentially many gigabytes of models to a new directory.
Author
Owner

@renich commented on GitHub (Jan 14, 2025):

I wonder why did they put it in /usr/share/ollama if they, already, have everything else in /usr/local...

<!-- gh-comment-id:2588711365 --> @renich commented on GitHub (Jan 14, 2025): I wonder why did they put it in `/usr/share/ollama` if they, already, have everything else in `/usr/local`...
Author
Owner

@dandv commented on GitHub (Feb 4, 2025):

@renich There's also an empty ~/.ollama directory in $HOME.

<!-- gh-comment-id:2633715589 --> @dandv commented on GitHub (Feb 4, 2025): @renich There's also an [empty ~/.ollama directory](https://github.com/ollama/ollama/issues/228#issuecomment-2633677089) in $HOME.
Author
Owner

@rick-github commented on GitHub (Feb 4, 2025):

~/.ollama was created when you ran ollama serve. /usr/share/ollama is used when ollama is run as a service.

<!-- gh-comment-id:2633722960 --> @rick-github commented on GitHub (Feb 4, 2025): `~/.ollama` was created when you ran `ollama serve`. `/usr/share/ollama` is used when ollama is run as a service.
Author
Owner

@renich commented on GitHub (Feb 4, 2025):

~/.ollama was created when you ran ollama serve. /usr/share/ollama is used when ollama is run as a service.

Indeed and this is wrong. ollama should use /usr/local/share/ollama if it wants to follow the FHS: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s09.html

And, about ~/.ollama, there's a spec for that too: https://specifications.freedesktop.org/basedir-spec/latest/

I mean, you're free to choose where you want to put stuff. But, if there're sane standards, why not follow them? Users; I, for one, will appreciate this.

<!-- gh-comment-id:2634686986 --> @renich commented on GitHub (Feb 4, 2025): > `~/.ollama` was created when you ran `ollama serve`. `/usr/share/ollama` is used when ollama is run as a service. Indeed and this is wrong. ollama should use `/usr/local/share/ollama` if it wants to follow the FHS: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s09.html And, about `~/.ollama`, there's a spec for that too: https://specifications.freedesktop.org/basedir-spec/latest/ I mean, you're free to choose where you want to put stuff. But, if there're sane standards, why not follow them? Users; I, for one, will appreciate this.
Author
Owner

@jonas-eschle commented on GitHub (Apr 22, 2025):

Adding to this, it would be easy enough to add in the installer an option to choose the path? Also, there is technically the OLLAMA_MODELS path, which is ignored. Therefore, it's even manually impossible to change the path

<!-- gh-comment-id:2821118487 --> @jonas-eschle commented on GitHub (Apr 22, 2025): Adding to this, it would be easy enough to add in the installer an option to choose the path? Also, there is technically the `OLLAMA_MODELS` path, which is ignored. Therefore, it's even manually impossible to change the path
Author
Owner

@rick-github commented on GitHub (Apr 22, 2025):

OLLAMA_MODELS, not OLLAMA_MODEL.

<!-- gh-comment-id:2821127255 --> @rick-github commented on GitHub (Apr 22, 2025): `OLLAMA_MODELS`, not `OLLAMA_MODEL`.
Author
Owner

@jonas-eschle commented on GitHub (Apr 22, 2025):

Typo in my comment, fixed. Bottom line is still that this doesn't work

<!-- gh-comment-id:2821134915 --> @jonas-eschle commented on GitHub (Apr 22, 2025): Typo in my comment, fixed. Bottom line is still that this doesn't work
Author
Owner

@rick-github commented on GitHub (Apr 22, 2025):

Evidence?

<!-- gh-comment-id:2821137091 --> @rick-github commented on GitHub (Apr 22, 2025): Evidence?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5312