Ollama Default Model Storage Path and Migration Guide (Avoid Filling Up C Drive)

A practical guide to Ollama's default model directories on Windows, macOS, and Linux, plus executable Windows steps to move models off the system drive.

When running local LLMs, the system drive is often the first thing to run out of space. Ollama stores models in user or system directories by default, so your C drive can fill up quickly without path planning.

Common Default Ollama Model Directories

  • Windows: C:\Users\<username>\.ollama\models
  • macOS: ~/.ollama/models
  • Linux: /usr/share/ollama/.ollama/models (may vary by installation method)

Windows: Move the Model Directory to a Non-System Drive

A practical choice is moving model storage to a path like D:\OllamaModels. The key is setting the OLLAMA_MODELS system environment variable.

1. Create the Target Directory

For example, create: D:\OllamaModels

2. Configure the System Environment Variable

  • Variable name: OLLAMA_MODELS
  • Variable value: D:\OllamaModels

You can set it in “System Properties -> Advanced -> Environment Variables”, or with an admin PowerShell command:

1
[System.Environment]::SetEnvironmentVariable("OLLAMA_MODELS", "D:\OllamaModels", "Machine")

3. Restart Ollama (or Reboot the System)

After setting the variable, restart the Ollama service/app. If you’re unsure whether it has taken effect, rebooting the PC is the most reliable option.

4. Verify the New Path Is Active

Pull any model and check whether new files appear under D:\OllamaModels.

5. Clean Up the Old Directory (After Confirmation)

Once models work correctly in the new location, remove old files to reclaim C drive space.

FAQ

Still Writing to C Drive After Configuration

  • Confirm the variable is a system variable, not a temporary session variable.
  • Confirm the Ollama process was restarted.
  • Verify the variable name is exactly OLLAMA_MODELS.

Do I Need to Migrate Existing Model Files

If you want to avoid re-downloading, stop Ollama, copy existing model files to the new directory, then restart Ollama and verify.

记录并分享
Built with Hugo
Theme Stack designed by Jimmy