To execute an ollama remove model command and free up local storage, run ollama rm <model-name> in your terminal. This command instructs the Ollama daemon to delete the target model manifest and immediately purge all unshared weight layers from your hard drive. If the model is currently active in memory, you should also unload it to ensure both system RAM and GPU VRAM are immediately released.
Testing multiple local AI models quickly consumes storage, with standard 7B models requiring 4GB to 6GB and larger checkpoints exceeding 20GB. This guide details how to delete single and multiple models, inspect the exact directories where Ollama stores layer files, and stop running instances to free hardware resources.
Prerequisites
- Ollama CLI: Installed and running on Linux, macOS, or Windows.
- Terminal Access: Standard shell access (Bash, Zsh, or PowerShell).
- Storage Permissions: Access to write and delete files within the Ollama models directory.
Step-by-Step: How to Remove a Model in Ollama
Step 1: List Installed Models
Before deleting files, check the exact model names, tags, and disk footprints across your library using ollama list (or ollama ls):
ollama list
The terminal outputs your local inventory:
NAME ID SIZE MODIFIED
llama3.2:latest a80c4f17acd5 2.0 GB 2 days ago
qwen2.5-coder:7b e5d160df6460 4.7 GB 5 days ago
mistral:latest f974a74358d6 4.1 GB 2 weeks ago
Step 2: Delete a Target Model
To delete a model, pass its name to ollama rm:
ollama rm mistral
If the model uses the default :latest tag, you do not need to specify it. Ollama removes the files and confirms:
deleted 'mistral'
Step 3: Remove Specific Model Tags
When you have several quantized versions or parameter sizes of the same model family, specify the exact tag:
ollama rm qwen2.5-coder:7b
Omitting the tag when a model has non-default tags causes Ollama to look strictly for :latest, returning an error if that tag does not exist.
Step 4: Delete Multiple Models
To delete multiple models simultaneously, pass their names separated by spaces:
ollama rm llama3.2:latest mistral:latest
Where Does Ollama Store Models?
A frequent question when managing disk space is where does ollama store models on the filesystem. Unlike bare-metal runtimes discussed in our comparison on Ollama vs llama.cpp: Speed, Control and When to Use Which, Ollama organizes model data into an image registry format similar to Docker.
By default, models reside in the following directories:
- Linux (System Service):
/usr/share/ollama/.ollama/models - Linux (User Account):
~/.ollama/models - macOS:
~/.ollama/models(under/Users/<username>/.ollama/models) - Windows:
C:\Users\%username%\.ollama\models - Docker:
/root/.ollama/models
Manifests and Blobs
Inside the models directory, Ollama splits assets into two subfolders:
manifests/: Small JSON files containing model configuration, architecture definitions, and cryptographic layer digests.blobs/: Content-addressable SHA-256 binary blobs containing actual GGUF model weights and tokenizer data.
Because Ollama deduplicates layers by hash, variants sharing the same base weights share the same blobs on disk. When you run ollama rm, Ollama deletes the manifest and removes only those blobs that are no longer referenced by any remaining model.
Changing the Storage Directory
To redirect Ollama to a secondary SSD, configure the OLLAMA_MODELS environment variable.
On Linux with systemd, run sudo systemctl edit ollama.service and add:
[Service]
Environment="OLLAMA_MODELS=/mnt/fast-storage/ollama/models"
Apply the change and restart the daemon:
sudo chown -R ollama:ollama /mnt/fast-storage/ollama/models
sudo systemctl daemon-reload
sudo systemctl restart ollama
On Windows, set OLLAMA_MODELS in User Environment Variables and restart the Ollama tray application.
How to Stop Ollama and Unload Active Models
Deleting a model removes it from disk, but if the model was loaded into GPU memory, you must also know how to stop ollama processes to reclaim RAM and VRAM.
Unload Models from VRAM Instantly
To inspect models currently active in memory, run:
ollama ps
To unload an active model without stopping the background service, run:
ollama stop llama3.2
This immediately releases graphics card VRAM. If you prefer managing models and memory via a graphical interface, explore our comparison on LM Studio vs Ollama: Which Local LLM Runner Should You Use?.
Stopping the Ollama Daemon
If you need to halt the Ollama server completely:
- Linux:
sudo systemctl stop ollama - macOS: Click the Ollama menu bar icon and select Quit Ollama, or run
pkill ollama. - Windows: Right-click the Ollama llama icon in the taskbar notification tray and choose Quit Ollama.
For administrators securing homelab or server deployments, review our comprehensive analysis on Is Ollama Safe? Risks of Exposed Ollama Servers and How to Lock Them Down.
Verifying Reclaimed Storage
After executing ollama rm, verify the model is removed from the local index:
ollama list
Confirm the recovered storage on Linux or macOS using:
df -h /usr/share/ollama/.ollama/models
Troubleshooting Common Errors
Error: Model Not Found
If you see Error: model 'qwen2.5' not found, you omitted a custom tag. Run ollama list to check whether the model is registered with a specific tag (such as :7b) and rerun the command with the exact identifier.
Disk Space Not Reclaimed
If free disk space does not increase after deletion, the model shared base layers with another installed model. Ollama preserves shared blobs until all dependent models are deleted.
Permission Denied on Linux
Do not delete files directly from /usr/share/ollama using rm -rf. Manual removal breaks the manifest index. Always use the ollama rm command to ensure clean garbage collection.
Ollama CLI Quick Reference
| Action | Command | Description |
|---|---|---|
| List Models | ollama list |
Lists all locally installed models and disk sizes |
| Remove Model | ollama rm <name:tag> |
Deletes manifest and unreferenced weight blobs |
| Check Running | ollama ps |
Shows models loaded in CPU RAM or GPU VRAM |
| Unload Model | ollama stop <name> |
Frees VRAM without restarting the service |
| Stop Service | sudo systemctl stop ollama |
Stops the systemd daemon on Linux hosts |
Frequently Asked Questions
Where does Ollama store models on Linux, macOS, and Windows?
On Linux running the standard systemd service, models are located in /usr/share/ollama/.ollama/models. On macOS, they are stored in ~/.ollama/models. On Windows, they reside in C:\Users\%username%\.ollama\models. You can change this path using the OLLAMA_MODELS environment variable.
How do you stop a running Ollama model without killing the server?
Run ollama stop <model-name> in your terminal. This immediately clears the model weights from GPU memory (VRAM) while keeping the Ollama HTTP API daemon active and ready to process new prompts.
Does removing a model delete shared layers or affect other models?
No. Ollama uses content-addressable storage where model weights are split into SHA-256 blobs. When you remove a model, Ollama only purges blobs unique to that model. Shared base layers remain intact, ensuring your other models continue to function normally.
Hi, I’m Mark, the author of Clever IT Solutions: Mastering Technology for Success. I am passionate about empowering individuals to navigate the ever-changing world of information technology. With years of experience in the industry, I have honed my skills and knowledge to share with you. At Clever IT Solutions, we are dedicated to teaching you how to tackle any IT challenge, helping you stay ahead in today’s digital world. From troubleshooting common issues to mastering complex technologies, I am here to guide you every step of the way. Join me on this journey as we unlock the secrets to IT success.



