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
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
Added configurations: *Replace path, user and group accordingly.
[Service] Environment="OLLAMA_MODELS=/path/to/ollama-models" User=raymond Group=raymond
Save the file.
Restart services:
sudo systemctl daemon-reload sudo systemctl restart ollama
Check ollama service status:
sudo systemctl status ollama
You should be able see something like the following screenshot: