By default, all models pulled from Ollama are stored in the /Users/username/.ollama
directory on macOS, where username
is your system's current user. If you want to change the model directory to another location, such as an external storage device, you can follow one of the methods below.
If you only want to change the model directory temporarily, execute the following command in Terminal and restart the Ollama app:
launchctl setenv OLLAMA_MODELS /path/to/new/location
For example, to change the model directory to an external storage device located at /Volumes/PSSD/Ollama-Models
, run:
launchctl setenv OLLAMA_MODELS /Volumes/PSSD/Ollama-Models
Starting from macOS 15 and later, adding the OLLAMA_MODELS
variable to the system environment (such as .zshrc
, .zshenv
, or .zprofile
) no longer works. To achieve a permanent solution, you can use the symbolic link (symlink) technique. Symbolic links act as advanced aliases (shortcuts) that redirect access to your original files, allowing you to store large files on an external drive without breaking application support.
The general syntax for creating a symbolic link is:
ln -s /path/to/new /path/to/original
In our case, you need to run the following two commands to map the manifests
and blobs
directories:
ln -s /Volumes/PSSD/Ollama-Models/blobs /Users/username/.ollama/models/blobs
ln -s /Volumes/PSSD/Ollama-Models/manifests /Users/username/.ollama/models/manifests
- Before running these commands, ensure that any existing directories in
/Users/username/.ollama/
are removed to avoid conflicts. - After executing the commands, two new alias directories will appear in
/Users/username/.ollama/
, identified by an icon with a small arrow in the bottom-left corner.
Following these methods, you can efficiently relocate your Ollama models to free up disk space or better organize your storage.