[GH-ISSUE #1352] Feature Request: 🛠️ Configurable Option to Prevent Automatic Activation of ollama.service on Linux #706

Closed
opened 2026-04-12 10:22:44 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @Samk13 on GitHub (Dec 2, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1352

Running on WSL2 Ubuntu 22

I'd like to inquire if there's an existing configuration option within Ollama that can stop the automatic activation of ollama.service on Linux systems.

Reason for this request is to conserve system resources, avoiding running unnecessary services.

Currently, after every update, I need to manually run the command:

sudo systemctl disable --now ollama.service

Is there a possibility to introduce a feature that makes this behavior configurable? 🛠️

Three practical solutions to control the automatic activation of ollama.service could be:

  • Ask the user if he/she wants to activate the service here
  • Command-Line Flags:
    such as --disable-auto-service or --no-service. Users can run Ollama with this flag to prevent the automatic activation of the service.
  • Disabled by Default, Enable with Installation Flag:
    Make ollama.service disabled by default. During installation or setup, provide an option like --enable-service to allow users to explicitly enable the service if they want it.
Originally created by @Samk13 on GitHub (Dec 2, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1352 Running on WSL2 Ubuntu 22 I'd like to inquire if there's an existing configuration option within Ollama that can stop the automatic activation of `ollama.service` on Linux systems. Reason for this request is to conserve system resources, avoiding running unnecessary services. Currently, after every update, I need to manually run the command: ```bash sudo systemctl disable --now ollama.service ``` Is there a possibility to introduce a feature that makes this behavior configurable? 🛠️ Three practical solutions to control the automatic activation of `ollama.service` could be: - Ask the user if he/she wants to activate the service [here](https://github.com/jmorganca/ollama/blob/main/scripts/install.sh#L113) - Command-Line Flags: such as --disable-auto-service or --no-service. Users can run Ollama with this flag to prevent the automatic activation of the service. - Disabled by Default, Enable with Installation Flag: Make `ollama.service` disabled by default. During installation or setup, provide an option like --enable-service to allow users to explicitly enable the service if they want it.
Author
Owner

@oliverbob commented on GitHub (Dec 3, 2023):

I second the motion.

<!-- gh-comment-id:1837320325 --> @oliverbob commented on GitHub (Dec 3, 2023): I second the motion.
Author
Owner

@computersrmyfriends commented on GitHub (Apr 10, 2024):

+1

<!-- gh-comment-id:2048237135 --> @computersrmyfriends commented on GitHub (Apr 10, 2024): +1
Author
Owner

@maxtheaxe commented on GitHub (Apr 12, 2024):

would like this as well

<!-- gh-comment-id:2051494087 --> @maxtheaxe commented on GitHub (Apr 12, 2024): would like this as well
Author
Owner

@jmorganca commented on GitHub (May 6, 2024):

Hi all, for this you can use a drop-in file:

[Service]
ExecStart=

See https://www.flatcar.org/docs/latest/setup/systemd/drop-in-units/ for example

<!-- gh-comment-id:2097091899 --> @jmorganca commented on GitHub (May 6, 2024): Hi all, for this you can use a drop-in file: ``` [Service] ExecStart= ``` See https://www.flatcar.org/docs/latest/setup/systemd/drop-in-units/ for example
Author
Owner

@Samk13 commented on GitHub (Jun 10, 2024):

@jmorganca Thanks for the feedback,
However, you didn't provide a realistic alternative solution like having a flag to disable auto service run during the installation, such as e.g.:
curl -fsSL https://ollama.com/install.sh | sh -- --services-off.
Using systemd drop-in units is an option, yes, but it might not be user-friendly for everyone.

# Create a drop-in directory and add content to disable the service
sudo mkdir -p /etc/systemd/system/ollama.service.d && echo -e "[Service]\nExecStart=" | sudo tee /etc/systemd/system/ollama.service.d/override.conf
# Reload the systemd daemon
sudo systemctl daemon-reload
# Mask the service to prevent it from starting
sudo systemctl mask ollama.service

The suggested solution is not ideal, as I will not make this change just for installing Ollama.
Relying on users' laziness to keep it running in the background is not a good idea to me, especially from a reputable company like yours!

Please reconsider other alternatives as this pushes users away from installing Ollama and limits user adoption.

<!-- gh-comment-id:2157906863 --> @Samk13 commented on GitHub (Jun 10, 2024): @jmorganca Thanks for the feedback, However, you didn't provide a realistic alternative solution like having a flag to disable auto service run during the installation, such as e.g.: `curl -fsSL https://ollama.com/install.sh | sh -- --services-off`. Using `systemd` drop-in units is an option, yes, but it might not be user-friendly for everyone. ```bash # Create a drop-in directory and add content to disable the service sudo mkdir -p /etc/systemd/system/ollama.service.d && echo -e "[Service]\nExecStart=" | sudo tee /etc/systemd/system/ollama.service.d/override.conf # Reload the systemd daemon sudo systemctl daemon-reload # Mask the service to prevent it from starting sudo systemctl mask ollama.service ``` The suggested solution is not ideal, as I will not make this change just for installing Ollama. Relying on users' laziness to keep it running in the background is not a good idea to me, especially from a reputable company like yours! Please reconsider other alternatives as this pushes users away from installing Ollama and limits user adoption.
Author
Owner

@damien-git commented on GitHub (Dec 15, 2024):

I had 3 services instead of ollama.service: snap-ollama-19.mount, snap-ollama-27.mount and snap.ollama.listener.service. Sorry, no time for this madness. Uninstalling it was my best option.

<!-- gh-comment-id:2543426314 --> @damien-git commented on GitHub (Dec 15, 2024): I had 3 services instead of ollama.service: `snap-ollama-19.mount`, `snap-ollama-27.mount` and `snap.ollama.listener.service`. Sorry, no time for this madness. Uninstalling it was my best option.
Author
Owner

@native-apps commented on GitHub (Oct 13, 2025):

Total regrets for installing this app.

<!-- gh-comment-id:3396371106 --> @native-apps commented on GitHub (Oct 13, 2025): Total regrets for installing this app.
Author
Owner

@shvedes commented on GitHub (Nov 3, 2025):

Total regrets for installing this app.

Doesn't help with the issue. Stop trash talking

<!-- gh-comment-id:3480194495 --> @shvedes commented on GitHub (Nov 3, 2025): > Total regrets for installing this app. Doesn't help with the issue. Stop trash talking
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#706