[GH-ISSUE #9623] Update on Linux should keep existing settings for ollama service #83964

Closed
opened 2026-05-09 19:28:56 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @stweil on GitHub (Mar 10, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9623

After an update on Linux with curl https://ollama.ai/install.sh | sh any environment settings which were made in /etc/systemd/system/ollama.service are lost. This breaks for example an installation which requires an API which not only listens on localhost (Environment="OLLAMA_HOST=0.0.0.0:11434").

Maybe I missed it, but I did not find a way to provide the settings in a persistent way.

Ideally the ollama service on Linux would read an optional file /etc/default/ollama with local ollama settings like it is done for other services. The installation then could provide a default file during the first installation and keep this file untouched in update installations.

Originally created by @stweil on GitHub (Mar 10, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9623 After an update on Linux with `curl https://ollama.ai/install.sh | sh` any environment settings which were made in /etc/systemd/system/ollama.service are lost. This breaks for example an installation which requires an API which not only listens on localhost (Environment="OLLAMA_HOST=0.0.0.0:11434"). Maybe I missed it, but I did not find a way to provide the settings in a persistent way. Ideally the ollama service on Linux would read an optional file /etc/default/ollama with local ollama settings like it is done for other services. The installation then could provide a default file during the first installation and keep this file untouched in update installations.
GiteaMirror added the feature request label 2026-05-09 19:28:56 -05:00
Author
Owner

@zkzkzk2015 commented on GitHub (Mar 10, 2025):

I second that one, after update my working installation gone havoc again.

<!-- gh-comment-id:2710496148 --> @zkzkzk2015 commented on GitHub (Mar 10, 2025): I second that one, after update my working installation gone havoc again.
Author
Owner

@rick-github commented on GitHub (Mar 10, 2025):

If you follow the provided instructions, an overrides file is created which is not modified during an upgrade.

<!-- gh-comment-id:2710536334 --> @rick-github commented on GitHub (Mar 10, 2025): If you follow the [provided instructions](https://github.com/ollama/ollama/blob/main/docs/faq.mdx#setting-environment-variables-on-linux), an overrides file is created which is not modified during an upgrade.
Author
Owner

@stweil commented on GitHub (Mar 10, 2025):

Right, I can confirm that the instructions in https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-linux work fine. Therefore I close this issue again.

Thank you!

<!-- gh-comment-id:2710544667 --> @stweil commented on GitHub (Mar 10, 2025): Right, I can confirm that the instructions in https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-linux work fine. Therefore I close this issue again. Thank you!
Author
Owner

@ApolloForge commented on GitHub (Apr 26, 2026):

Both links go to 'File Not Found'. This is still problem. I manually copy over the service file as a back up. It would be nice to have a switch or a way for this to be better preserved. I mostly have the location of the models on a larger drive and the installation of Ollama and my base Linux running on a faster SSD.

<!-- gh-comment-id:4322952004 --> @ApolloForge commented on GitHub (Apr 26, 2026): Both links go to 'File Not Found'. This is still problem. I manually copy over the service file as a back up. It would be nice to have a switch or a way for this to be better preserved. I mostly have the location of the models on a larger drive and the installation of Ollama and my base Linux running on a faster SSD.
Author
Owner

@stweil commented on GitHub (Apr 26, 2026):

All persistent settings must be added to a new file /etc/systemd/system/ollama.service.d/override.conf. Example:

[Service]
# CPU only.
#Environment="CUDA_VISIBLE_DEVICES="
# CPU and GPU.
#Environment="OLLAMA_GPU_LAYERS=20"
Environment="OLLAMA_HOST=0.0.0.0:11434"
Environment="OLLAMA_KEEP_ALIVE=10m"
Environment="PATH=/usr/local/bin:/usr/sbin:/usr/bin"
<!-- gh-comment-id:4322977473 --> @stweil commented on GitHub (Apr 26, 2026): All persistent settings must be added to a new file /etc/systemd/system/ollama.service.d/override.conf. Example: ``` [Service] # CPU only. #Environment="CUDA_VISIBLE_DEVICES=" # CPU and GPU. #Environment="OLLAMA_GPU_LAYERS=20" Environment="OLLAMA_HOST=0.0.0.0:11434" Environment="OLLAMA_KEEP_ALIVE=10m" Environment="PATH=/usr/local/bin:/usr/sbin:/usr/bin" ```
Author
Owner

@stweil commented on GitHub (Apr 26, 2026):

The new location of the instructions is https://github.com/ollama/ollama/blob/main/docs/faq.mdx#setting-environment-variables-on-linux.

<!-- gh-comment-id:4322983080 --> @stweil commented on GitHub (Apr 26, 2026): The new location of the instructions is https://github.com/ollama/ollama/blob/main/docs/faq.mdx#setting-environment-variables-on-linux.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#83964