Change Models Path on Ubuntu for Ollama

Raymond Raymond event 2024-08-06 visibility 767
more_vert
Change Models Path on Ubuntu for Ollama

On Ubuntu, Ollama saves models by default to /usr/share/ollama/.ollama/models.

This article shows you how to change the default path to a different location.


Steps

  1. Create ollama service config override file:

    sudo mkdir -p /etc/systemd/system/ollama.service.d; sudo nano /etc/systemd/system/ollama.service.d/override.conf
  2. Added configurations:

    *Replace path, user and group accordingly. 

    [Service]
    Environment="OLLAMA_MODELS=/path/to/ollama-models"
    User=raymond
    Group=raymond
    

    20240806132523-image.png

  3. Save the file.

  4. Restart services:

    sudo systemctl daemon-reload
    sudo systemctl restart ollama
  5. Check ollama service status:

    sudo systemctl status ollama

    You should be able see something like the following screenshot:

    20240806132920-image.png

More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts