[GH-ISSUE #1494] suggestion: download models to home directory instead of /usr/share/ on linux ? #26567

Closed
opened 2026-04-22 02:55:04 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @hualet on GitHub (Dec 13, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1494

I suggest that models should be downloaded to home directory like ~/.ollama/models instead of /usr/share/ollama/.ollama/models, since I think it's a conviention that data should be in home not root.

I didn't create root with a copacity big enough and encounter this 😂

image

Originally created by @hualet on GitHub (Dec 13, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1494 I suggest that models should be downloaded to home directory like `~/.ollama/models` instead of `/usr/share/ollama/.ollama/models`, since I think it's a conviention that data should be in home not root. I didn't create root with a copacity big enough and encounter this :joy: ![image](https://github.com/jmorganca/ollama/assets/2023967/5017e347-32ce-4da2-a6a5-df75cf711700)
Author
Owner

@rgaidot commented on GitHub (Dec 13, 2023):

This should be the case https://github.com/jmorganca/ollama/blob/main/server/modelpath.go#L108C18-L108C29 - Maybe variable $HOME is not set in the environment (in your host 🤔) and/or UserHomeDir returns default value.

So I've the same issue

<!-- gh-comment-id:1853947868 --> @rgaidot commented on GitHub (Dec 13, 2023): This should be the case https://github.com/jmorganca/ollama/blob/main/server/modelpath.go#L108C18-L108C29 - Maybe variable `$HOME` is not set in the environment (in your host 🤔) and/or `UserHomeDir` returns default value. So I've the same issue
Author
Owner

@BruceMacD commented on GitHub (Dec 13, 2023):

Hey y'all, thanks for the feedback. There is actually an environment variable you can set to change the location the Ollama models are stored, here's the doc:
https://github.com/jmorganca/ollama/blob/main/docs/faq.md#how-can-i-change-where-ollama-stores-models

Hope that helps.

<!-- gh-comment-id:1854282851 --> @BruceMacD commented on GitHub (Dec 13, 2023): Hey y'all, thanks for the feedback. There is actually an environment variable you can set to change the location the Ollama models are stored, here's the doc: https://github.com/jmorganca/ollama/blob/main/docs/faq.md#how-can-i-change-where-ollama-stores-models Hope that helps.
Author
Owner

@hualet commented on GitHub (Dec 16, 2023):

Hey y'all, thanks for the feedback. There is actually an environment variable you can set to change the location the Ollama models are stored, here's the doc: https://github.com/jmorganca/ollama/blob/main/docs/faq.md#how-can-i-change-where-ollama-stores-models

Hope that helps.

It's not working here, any more information I should provide ?

<!-- gh-comment-id:1858764705 --> @hualet commented on GitHub (Dec 16, 2023): > Hey y'all, thanks for the feedback. There is actually an environment variable you can set to change the location the Ollama models are stored, here's the doc: https://github.com/jmorganca/ollama/blob/main/docs/faq.md#how-can-i-change-where-ollama-stores-models > > Hope that helps. It's not working here, any more information I should provide ?
Author
Owner

@maxim-sermin commented on GitHub (Dec 19, 2023):

Setting OLLAMA_MODELS also didn't work for me. However, I could get a similar result by changing the User/Group of the ollama systemd unit to be my user:

Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
User=<YOUR USERNAME GOES HERE>
Group=<YOUR GROUPNAME GOES HERE>
...

Then run systemctl daemon-reload && systemctl restart ollama to apply the changes

<!-- gh-comment-id:1862555117 --> @maxim-sermin commented on GitHub (Dec 19, 2023): Setting `OLLAMA_MODELS` also didn't work for me. However, I could get a similar result by changing the User/Group of the ollama systemd unit to be my user: ``` Unit] Description=Ollama Service After=network-online.target [Service] ExecStart=/usr/local/bin/ollama serve User=<YOUR USERNAME GOES HERE> Group=<YOUR GROUPNAME GOES HERE> ... ``` Then run `systemctl daemon-reload && systemctl restart ollama` to apply the changes
Author
Owner

@wenxichen commented on GitHub (Dec 23, 2023):

Setting OLLAMA_MODELS also didn't work for me. However, I could get a similar result by changing the User/Group of the ollama systemd unit to be my user:

Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
User=<YOUR USERNAME GOES HERE>
Group=<YOUR GROUPNAME GOES HERE>
...

Then run systemctl daemon-reload && systemctl restart ollama to apply the changes

This works for me. After setting the User and Group, I was able to add the following line under [Service]
Environment="OLLAMA_MODELS=<my_custom_folder_full_path>"
And now my models are downloaded to my custom folder.

<!-- gh-comment-id:1868163446 --> @wenxichen commented on GitHub (Dec 23, 2023): > Setting `OLLAMA_MODELS` also didn't work for me. However, I could get a similar result by changing the User/Group of the ollama systemd unit to be my user: > > ``` > Unit] > Description=Ollama Service > After=network-online.target > > [Service] > ExecStart=/usr/local/bin/ollama serve > User=<YOUR USERNAME GOES HERE> > Group=<YOUR GROUPNAME GOES HERE> > ... > ``` > > Then run `systemctl daemon-reload && systemctl restart ollama` to apply the changes This works for me. After setting the User and Group, I was able to add the following line under [Service] `Environment="OLLAMA_MODELS=<my_custom_folder_full_path>"` And now my models are downloaded to my custom folder.
Author
Owner

@hualet commented on GitHub (Dec 25, 2023):

Ah, I see. The environment should be set to the daemon, not the cli client. Thanks @maxim-sermin @wenxichen

<!-- gh-comment-id:1869007081 --> @hualet commented on GitHub (Dec 25, 2023): Ah, I see. The environment should be set to the daemon, not the cli client. Thanks @maxim-sermin @wenxichen
Author
Owner

@theodufort commented on GitHub (Jun 25, 2024):

Setting OLLAMA_MODELS also didn't work for me. However, I could get a similar result by changing the User/Group of the ollama systemd unit to be my user:

Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
User=<YOUR USERNAME GOES HERE>
Group=<YOUR GROUPNAME GOES HERE>
...

Then run systemctl daemon-reload && systemctl restart ollama to apply the changes

This works for me. After setting the User and Group, I was able to add the following line under [Service] Environment="OLLAMA_MODELS=<my_custom_folder_full_path>" And now my models are downloaded to my custom folder.

Fixed it for me too!

P.S: Make sure you set the new folder's destination to your_user:your_group for permission's sake.

<!-- gh-comment-id:2189633443 --> @theodufort commented on GitHub (Jun 25, 2024): > > Setting `OLLAMA_MODELS` also didn't work for me. However, I could get a similar result by changing the User/Group of the ollama systemd unit to be my user: > > ``` > > Unit] > > Description=Ollama Service > > After=network-online.target > > > > [Service] > > ExecStart=/usr/local/bin/ollama serve > > User=<YOUR USERNAME GOES HERE> > > Group=<YOUR GROUPNAME GOES HERE> > > ... > > ``` > > > > > > > > > > > > > > > > > > > > > > > > Then run `systemctl daemon-reload && systemctl restart ollama` to apply the changes > > This works for me. After setting the User and Group, I was able to add the following line under [Service] `Environment="OLLAMA_MODELS=<my_custom_folder_full_path>"` And now my models are downloaded to my custom folder. Fixed it for me too! P.S: Make sure you set the new folder's destination to your_user:your_group for permission's sake.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#26567