By default, Ollama stores its models in ~/.ollama/models on macOS.
If you need to store models on a different disk or location (for example, on an external drive with more space), you can configure this using the OLLAMA_MODELS environment variable.
Because even the small models get big, fast:
| |
Temporary Configuration (Current Session Only)
To set the location for your current terminal session:
| |
This will only last until you close the terminal window.
Permanent Configuration
To make the change permanent, add the environment variable to your shell profile:
For Zsh (default on macOS Catalina and later):
| |
Replace
/path/to/your/modelswith your desired location, such as/Volumes/ExternalDrive/ollama/models. On my machine it’s/Volumes/Fast/ollama/modelsbecause my external disk is also, you know, fast!!!
Restarting Ollama
After setting the environment variable, restart Ollama for the changes to take effect:
| |

Ollama startup showing the new location
Moving Existing Models
If you’ve already downloaded models and want to move them to the new location:
Stop Ollama:
1pkill ollamaCopy your existing models:
1cp -r ~/.ollama/models /path/to/your/modelsSet the environment variable (as described above)
Restart Ollama:
1ollama serveVerify the models are accessible:
1ollama list
Verifying Your Configuration
To confirm that Ollama is using your custom location:
| |
This should display your configured path. You can also check that models are being stored in the new location by running a model and then checking the directory contents.
Troubleshooting
Models not appearing after restart:
- Ensure the
OLLAMA_MODELSpath exists and has proper read/write permissions - Check that the environment variable is set:
echo $OLLAMA_MODELS - Make sure you’ve sourced your shell profile or opened a new terminal window
- This is so obvious it’s not worth mentioning…except that I forgot this and finally realized why things weren’t working :-\
Permission denied errors:
- Ensure your user has read/write permissions to the target directory:
1chmod -R 755 /path/to/your/models
Additional Resources
- Ollama Official Documentation
- Ollama GitHub Repository
- Ollama Model Library
- Environment Variable Configuration
See Also
- Week 3: Agents blog
- RAFT for RAG blog
- Interpret LLM Model Size til
- Week 2: Adapting LLMs blog
- Week 1: LLM Foundations blog