[GH-ISSUE #5984] [Linux] Install ollama to /home/user/ space #3743

Closed
opened 2026-04-12 14:33:12 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @bebyx on GitHub (Jul 26, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5984

Originally assigned to: @dhiltgen on GitHub.

I have several partitions on my Linux machine. My system partition (/) is small and I didn't have enough space for models. However, I have a lot of space in the /home/ partition.

Setting $OLLAMA_MODELS to /home/user/.ollama/models didn't help; it still installed them to /usr/share/ollama/.ollama/models.

I didn't see an option for installing ollama to the home space (somewhere under /home/user/). So, I created a script to do that for my convenience.

#!/bin/bash

curl -L https://ollama.com/download/ollama-linux-amd64 -o $HOME/.local/bin/ollama
chmod +x $HOME/.local/bin/ollama

cat <<EOF > ~/.config/systemd/user/ollama.service
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=$HOME/.local/bin/ollama serve
Restart=always
RestartSec=3

[Install]
WantedBy=default.target
EOF

systemctl --user daemon-reload
systemctl --user restart ollama

Just wondering if you would consider providing an alternative script to install ollama to the home user space. My script can be used as a foundation.

Originally created by @bebyx on GitHub (Jul 26, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5984 Originally assigned to: @dhiltgen on GitHub. I have several partitions on my Linux machine. My system partition (`/`) is small and I didn't have enough space for models. However, I have a lot of space in the `/home/` partition. Setting `$OLLAMA_MODELS` to `/home/user/.ollama/models` didn't help; it still installed them to `/usr/share/ollama/.ollama/models`. I didn't see an option for installing **ollama** to the home space (somewhere under `/home/user/`). So, I created a [script](https://gist.github.com/bebyx/8cecd83a2d7c94a8f7c6352298db7c9e) to do that for my convenience. ```bash #!/bin/bash curl -L https://ollama.com/download/ollama-linux-amd64 -o $HOME/.local/bin/ollama chmod +x $HOME/.local/bin/ollama cat <<EOF > ~/.config/systemd/user/ollama.service [Unit] Description=Ollama Service After=network-online.target [Service] ExecStart=$HOME/.local/bin/ollama serve Restart=always RestartSec=3 [Install] WantedBy=default.target EOF systemctl --user daemon-reload systemctl --user restart ollama ``` Just wondering if you would consider providing an alternative script to install **ollama** to the home user space. My script can be used as a foundation.
GiteaMirror added the feature request label 2026-04-12 14:33:12 -05:00
Author
Owner

@jmorganca commented on GitHub (Sep 4, 2024):

Hi @bebyx, sorry the install script isn't flexible enough to support that. Check out the manual install instructions which aren't much more involved (just make sure to install your Nvidia/AMD drivers if you have a GPU): https://github.com/ollama/ollama/blob/main/docs/linux.md#manual-install

<!-- gh-comment-id:2327888983 --> @jmorganca commented on GitHub (Sep 4, 2024): Hi @bebyx, sorry the install script isn't flexible enough to support that. Check out the manual install instructions which aren't much more involved (just make sure to install your Nvidia/AMD drivers if you have a GPU): https://github.com/ollama/ollama/blob/main/docs/linux.md#manual-install
Author
Owner

@dewdgi commented on GitHub (Jun 14, 2025):

Is there a reason why ollama can't provide something like

Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/bin/ollama serve
Restart=always
RestartSec=3
Environment="PATH=$PATH"

[Install]
WantedBy=default.target

in /etc/systemd/user/ollama.service?
It is very useful, if i have separated /home partition and i want to install ollama models in my user directory.
If ollama is launched under user, i don't need to adjust anything like environment variables or permissions

<!-- gh-comment-id:2973355650 --> @dewdgi commented on GitHub (Jun 14, 2025): Is there a reason why ollama can't provide something like ```[Unit] Description=Ollama Service After=network-online.target [Service] ExecStart=/usr/bin/ollama serve Restart=always RestartSec=3 Environment="PATH=$PATH" [Install] WantedBy=default.target ``` in **/etc/systemd/user/ollama.service**? It is very useful, if i have separated /home partition and i want to install ollama models in my user directory. If ollama is launched under user, i don't need to adjust anything like environment variables or permissions
Author
Owner

@iva-nova-e-katerina commented on GitHub (Sep 17, 2025):

I have the same issue: root partition is too small for models

<!-- gh-comment-id:3302192525 --> @iva-nova-e-katerina commented on GitHub (Sep 17, 2025): I have the same issue: root partition is too small for models
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#3743