SSD Nodes Learn Hosting plans →
How to do am Matt ConnorBy Matt Connor

Ollama pull vs run: models dey live for where?

Learn wetin ollama pull and ollama run dey do, the embedding models gotcha, where files dey land, why VPS root disk dey fill, and how to move dem.

ollama pull vs ollama run

ollama pull go download model and stop. For local chat model, ollama run go download the model only if e no dey, then load am for memory and open interactive chat. The download na the same, and the files go land for the same place. Na only run dey continue after that. Embedding models na exception to the chat part: the official documentation show say ollama run embeddinggemma "Hello world" dey print the embedding as JSON array instead of reply. If input text no dey, ollama run go reject embedding model with embedding models require input text.

Na this one difference dey decide which command belong for script and which one belong when person dey type for keyboard.

ollama pull gemma4
ollama run gemma4
ollama run gemma4 "Reply with one word: ready"

The first line go fetch model and exit, so e safe for provisioning and inside systemd unit. The second one go open chat session; type /bye or press Ctrl+D to comot. The third one go send one prompt, print the answer, then exit. Na this format script want when e need answer instead of session. But this third format still leave reply length completely to the model. So one-line question fit return three paragraphs. capping the answer with num_predict na wetin go keep scripted run inside size wey caller fit actually use. Model names dey change quickly, so treat gemma4 here as placeholder: na the example wey official Ollama documentation dey use as of October 2026; substitute another local chat model for the same workflow. Tags wey end with :cloud, like gemma4:cloud, different: Ollama dey run dem for its own servers without downloading the model weights, so the disk space below na for local models. If you prefer substitute model wey person don size against real server already, running Nemotron 3.5 Lightning on a VPS go give you the exact tag to pull and the memory wey e expect to find.

Why first ollama run dey look like e don hang

First run for fresh VPS fit stay without output for several minutes. Nothing spoil. Chat prompt no fit show until model don enter disk and load for memory, so run dey do multi-gigabyte download before e get anything to show you.

Two things dey hide this work. Ollama dey write progress bar to standard error, so anywhere wey dem throw away that stream or read am only later, like script wey end with 2>/dev/null or cron job, nothing go tell you say download dey run. Then, after the bytes don land, system still need read the file from disk enter RAM before the first token. For small VPS, this read fit slow. If the box no get enough memory for the model, kernel go start swapping and the wait go become much longer.

Watch am from second session instead of guessing:

df -h /
watch -n5 df -h /

For fresh box, if free space dey reduce in steps, download still dey run. If free space stop reducing while command still busy, that one no prove say loading don start. After download, Ollama dey do separate verifying sha256 digest phase wey reads the files before e write manifest and complete the pull. Box wey already hold models fit confuse you for Ollama 0.40.2. First run of model wey older version download fit write upgraded copy for background and keep original as backup, so free space fit reduce even when no download dey happen. Ollama 0.40.3, wey release on 11 October 2026, pause that background upgrade.

Na why you suppose pull ahead of time. Person wey type ollama run no suppose be the person wey go pay for the download.

Pull the model before anybody ask for am

The same thing apply to anything wey no be person: a coding agent wey point to your Ollama endpoint go get model-not-found error if dem never pull the requested local model; inference request no dey download am. For new box, pull am inside the same script wey install the server:

curl -fsSL https://ollama.com/install.sh | sh
ollama pull gemma4

If na the first time you dey set up the server, the complete Ollama on a VPS installation explain the service itself and who get permission to reach am. After that, the useful thing to set up na pull wey go continue after your terminal close, because download wey stop halfway fit leave model store only partly populated.

Run am inside tmux, or give am to systemd as one-shot unit wey runs at boot. Write /etc/systemd/system/ollama-pull.service:

[Unit]
Description=Pre-pull Ollama models
Wants=ollama.service network-online.target
After=ollama.service network-online.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c 'until ollama list >/dev/null 2>&1; do sleep 2; done'
ExecStart=/bin/sh -c 'ollama pull gemma4'

[Install]
WantedBy=multi-user.target

Both commands dey run through /bin/sh -c by intention. Bare ExecStart= accepts absolute path or simple executable name wey systemd resolve through its fixed search path; command -v ollama shows the path wey your current shell finds. When you pass through the shell, e uses the service PATH instead of path wey person copy from guide. The first ExecStart matter too: After=ollama.service mean say the server unit don start, but that no mean say e ready, so the loop waits until ollama list answers before the pull starts.

sudo systemctl daemon-reload
sudo systemctl enable --now ollama-pull.service
journalctl -u ollama-pull.service

The journal suppose show say the pull finish without error, and ollama list suppose then show the model. To keep moving tag current, add systemd timer or weekly cron entry wey runs the same pull. Re-pulling tag wey don move downloads the new layers and, for most models, deletes old layers wey nothing else dey use at the end of that same pull.

Wetín happen when pull stop halfway

Every layer of model dey stored under hash of the contents wey belong to am. So, interrupted pull no be wasted work: run the same ollama pull again, and e go recognise and skip the layers wey don finish already. The download go continue from the layer wey stop halfway.

One action fit destroy that progress. When Ollama server start, e dey remove partial downloads and stored layers wey no model manifest dey refer to. The pieces wey dead pull leave behind na exactly that kind files. Current releases (0.40.11, checked 26 October 2026) skip any file wey dem write within the last hour. So, if you restart soon after the pull stop, no problem. But if you restart hours later, e go throw away the piece wey don download already. Retry the pull first, then restart later. If partial download really need survive restart, set OLLAMA_NOPRUNE=1 for service environment, then remove am later. This variable also disables the cleanup wey happen at the end of every pull. Both cleanups dey prevent orphaned layers from piling up for disk.

If the pull stop with no space left on device, free space before you retry. If df report say disk full and du for model directory no explain the space, the space dey somewhere else. Read the reasons wey make df and du disagree before you delete anything.

Ollama dey store models for where on VPS?

Ask your own box instead of trusting path from any guide, including this one. Location dey differ between package install and container. E go change again if anybody don set OLLAMA_MODELS.

systemctl cat ollama.service
getent passwd ollama
sudo find / -xdev -type d -name blobs 2>/dev/null

systemctl cat dey print the unit file together with every drop-in. So, any OLLAMA_MODELS line wey you set or wey dey inside your image go show there. If no such line dey, the store dey under the home directory of the account wey the service dey run as. getent passwd dey print that home directory for the sixth colon-separated field. find dey search one filesystem for the blobs directory. Na for there the layers actually dey written. Remove -xdev if the models fit already dey for separate mount.

Now measure am, then read your own numbers:

ollama list
df -h /
sudo du -sh /the/directory/you/found
sudo du -h -d1 /the/directory/you/found

The store get two kinds of content. The manifest directories (manifests, joined by manifests-v2 for current releases) hold small files wey list the layers each model tag dey built from. blobs hold the layers themselves. Each layer get the hash of its contents as name, and almost all the size dey there. Because tags dey share layers, two models wey use the same weights fit each report their own size for ollama list, even though the disk space dey used only once. So, the listed sizes fit add up to more than du report for the directory. The opposite surprise come from Ollama 0.40.2: models wey e upgrade in the background keep their original copy for disk as backup. ollama list no show those copies twice, so du fit report much more than the list suggest. The 0.40.2 release notes include script wey delete only those backups.

Model files fit fill small VPS root filesystem faster than almost anything else wey you likely go install. The biggest thing wey affect their size na the weight format. How to choose between q4, q8 and fp16 fit save gigabytes for each model.

Move the models go data volume with OLLAMA_MODELS

If the plan get second disk or bigger data volume, move the store before root filesystem full. Stop the server first, so you no copy file wey still dey write.

sudo systemctl stop ollama
sudo mkdir -p /mnt/data/ollama-models
sudo rsync -a /the/directory/you/found/ /mnt/data/ollama-models/
sudo chown -R ollama:ollama /mnt/data/ollama-models
sudo systemctl edit ollama.service

systemctl edit go open editor for drop-in file, so packaged unit remain untouched and package upgrade no fit overwrite your change. Add these two lines:

[Service]
Environment="OLLAMA_MODELS=/mnt/data/ollama-models"
sudo systemctl daemon-reload
sudo systemctl restart ollama
systemctl show ollama --property=Environment
ollama list

systemctl show suppose print your new path, and ollama list suppose show the same models wey e show before the move. If the list empty, check say the new directory contain the copied store and say the server fit read am. The service dey run as ollama user, so that user need read and write access to the destination. Na chown line above dey provide this access. Check journalctl -e -u ollama for permission errors wey mention the new path. Delete the old copy only after the list correct, because failed move plus deleted source mean say you go download everything again.

The other option keep the original path and mount the data volume on top of am:

echo '/mnt/data/ollama-models /the/directory/you/found none bind 0 0' | sudo tee -a /etc/fstab
sudo mount -a
findmnt /the/directory/you/found
df -h /

findmnt wey print the mount mean say the bind dey active. Bind mount dey useful when another thing for the box already expect the default location. E get one problem: the files wey you copy out still dey under the mount point for root disk, but the mount hide dem. The space no go return until you unmount and remove dem. The environment variable easier to explain to whoever log in next.

Where container dey keep dem instead

The official image dey store models inside whatever you mount, not inside any host directory wey belong to an ollama user. The documented run command na:

docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama

ollama before the colon na named Docker volume, while /root/.ollama na where the server dey write inside the container. So du against the paths from the previous section no go find anything, because nothing dey there. Print the real location and size:

docker volume inspect ollama
docker system df -v
docker exec -it ollama ollama list

Read the Mountpoint field from docker volume inspect, then run sudo du -sh against am. To put the models for data volume, replace the named volume with host directory (-v /mnt/data/ollama:/root/.ollama) and recreate the container. The container dey write as root, so that host directory go end up owned by root. Under rootless Podman, container root dey map to your host user's UID and GID by default, while other container IDs dey use subordinate ranges: how to run Ollama under rootless Podman cover that mapping.

One warning about cleanup. Plain docker volume prune dey remove only anonymous volumes, so e leave the named ollama volume, but docker volume prune --all dey remove every volume wey no container dey refer to, including named ones. If you remove or recreate the ollama container without its volume, later prune --all go delete every model wey you download, and no way dey to recover dem except downloading dem again. Read how to prune Docker disk usage on a VPS before you run prune for box wey dey host models.

Remove model with ollama rm, no be with rm

ollama list
ollama rm gemma4
ollama list
df -h /

ollama rm dey delete manifest for that tag, then e delete layers wey no remaining manifest still dey refer to. Space go come back immediately once dem unlink those files, so df dey move straight away. Because layers dey shared, removing one of two tags wey closely relate fit free space wey far smaller than the size ollama list print beside am. Na correct behaviour be that, no be failed delete.

Deleting files by hand dey break the pair. Remove blob with rm and manifest still list am, so ollama list go still dey show the model, and any attempt to use am go fail when e try read the missing layer. Remove manifest by hand and the layers go remain for disk with nothing pointing to dem, so dem go hold space wey no Ollama command go report to you. If you don already delete blob, ollama rm on the tag go clear the leftover entry; if you delete manifest, no tag entry remain to remove. Restarting the server go clear layers wey nothing dey refer to once dem don pass one hour old.

One last difference, because people dey mix the two up all the time. ollama rm na about disk. ollama stop gemma4 dey unload model from memory and e no free any disk space. How long model go remain inside RAM after download finish na separate setting, and how to keep model loaded instead of reloading am for every request explain am.

FAQ

Wetin be di difference between ollama pull and ollama run?

ollama pull dey download model go disk, then e stop. ollama run dey check whether model don already dey disk; if e no dey, e download am, load am into memory, then, for chat model, e open interactive chat session. Both dey write the same files for the same directory. Use pull for provisioning and scripts, and use run when person dey for keyboard. ollama run <model> "your prompt" dey send one prompt, then e stop. Na the scriptable form of run.

Why my first ollama run dey look like e hang?

E fit dey download, verify the download, or load the model. Chat prompt no fit show until model dey disk and don load into memory, and model fit be several gigabytes. Ollama dey write progress bar to standard error, so run inside script wey dey discard that stream, or inside cron job, no go show you anything while e dey work. Open second session and run watch -n5 df -h /. For fresh box, if free space dey reduce by steps, download dey happen. Pull the model ahead of time to remove the download and verification wait; loading still go take time.

Where Ollama dey store its models?

The location depend on the installation, so print am instead of assuming. Run systemctl cat ollama.service to see whether OLLAMA_MODELS dey set for the unit or drop-in. If e no dey set, the store dey under the home directory of the account wey the service dey run as, and getent passwd ollama go print am. sudo find / -xdev -type d -name blobs 2>/dev/null dey locate the layer directory directly. For container image, the store dey inside the mounted volume, and docker volume inspect ollama go print its host Mountpoint.

How I fit move Ollama models go another disk?

Stop the service, copy the store go the new location with rsync -a, give the directory to the service account with sudo chown -R ollama:ollama <directory>, then run sudo systemctl edit ollama.service and add Environment="OLLAMA_MODELS=<directory>" under [Service] line. Reload with sudo systemctl daemon-reload and restart. Confirm with systemctl show ollama --property=Environment and ollama list. If the list empty, check say the new directory get the copied store and say ollama user fit read am; check journalctl -e -u ollama for permission errors.

Deleting the model files go free the space?

Deleting files by hand go free the bytes, but e go leave the store inconsistent. If you remove blob, manifest still dey list that model, so e go continue appear for ollama list and e go fail when you use am. If you remove manifest, its layers go remain for disk with nothing wey dey refer to dem. Use ollama rm <model>. E dey delete the manifest, then the layers wey no other model need. If blob don already delete by hand, run ollama rm on the tag to clear the entry. If manifest don delete, no tag entry remain to remove. Restart the server to remove layers wey no manifest dey refer to, once dem don pass one hour old.

Dis article help you?