Skip to main content
Local AI

Ollama Commands Cheat Sheet: Pull, Run, Remove, Update

Every Ollama command in one place: pull, run, list, ps, stop and rm, plus how to update, change the model folder and context length, and fix common errors.

Advertisement
Updated 1 Dec 2026
Advertisement
Quick answer: the Ollama commands you will use most are ollama pull MODEL (download), ollama run MODEL (chat), ollama list (what is installed), ollama ps (what is loaded and whether it is on the GPU), ollama stop MODEL (free the memory) and ollama rm MODEL (delete it from disk). Everything else, from changing the model folder to opening Ollama to your network, is done with environment variables such as OLLAMA_MODELS and OLLAMA_HOST.
CheckedThe command list, help output and error messages on this page were run on 30 November 2026 on a Windows 11 PC with an NVIDIA RTX 2060 Super (8 GB) and Ollama 0.40.18. The newest release at that date was 0.40.19 (26 November 2026). Settings and file paths come from the official Ollama documentation, linked at the end.

Ollama commands cheat sheet

This is the full list that ollama --help prints in version 0.40.18, with what each one is for.

CommandWhat it does
ollama run MODELStarts a chat with a model, downloading it first if it is not on the machine.
ollama run MODEL "prompt"One answer, then back to the shell. Good for scripts.
ollama pull MODELDownloads a model (or updates it) without starting a chat.
ollama list or ollama lsLists the models stored on disk, with size and age.
ollama psLists the models loaded in memory right now, and how much is on GPU or CPU.
ollama stop MODELUnloads a model from memory straight away. It stays on disk.
ollama rm MODELDeletes a model from disk.
ollama show MODELShows architecture, size, context length, quantisation, capabilities and default parameters.
ollama cp SOURCE TARGETCopies a model under a new name (handy before editing it).
ollama create NAME -f ModelfileBuilds a custom model from a Modelfile (base model, system prompt, parameters).
ollama serve (alias ollama start)Starts the Ollama server by hand. Not needed if the desktop app or the Linux service is running.
ollama push NAMEUploads your own model to a registry.
ollama signin / ollama signoutSigns in to ollama.com (needed only for cloud models and publishing).
ollama launchSets up and starts a supported app (Claude Code, Codex, OpenCode, VS Code, Droid) against an Ollama model.
ollama -vPrints the installed version.

Two global flags are worth knowing: --verbose prints timings after each answer (load time, prompt speed and generation speed in tokens per second), and --nowordwrap stops the terminal wrapping long lines.

Advertisement

How to download a model in Ollama

Pick a name from the Ollama library and pull it. A name without a tag gets the latest tag; add a tag to choose a size or quantisation.

ollama pull qwen3.5:2b
ollama pull gemma4

According to the API documentation, a cancelled pull resumes from where it stopped, so you can press Ctrl+C on a slow download and run the same command later. Models from Hugging Face can be pulled by their full path, for example ollama pull hf.co/USER/REPO-GGUF:Q4_K_M; ollama list then shows them under that long name. The same GGUF files also run without Ollama in llama.cpp, using its -hf option.

Not sure which size your graphics card can hold? Will It Run? checks a model against your GPU or Mac, and the quantisation guide explains what tags like Q4_K_M and Q8_0 mean.

How to see which models are installed

ollama list shows what is on disk. On the test PC it printed:

NAME          ID              SIZE      MODIFIED
qwen3.5:2b    0689d44085e0    2.7 GB    9 days ago

For the details of one model, use ollama show. For qwen3.5:2b it reported 1.9B parameters, a 262,144-token maximum context, Q8_0 quantisation, and the capabilities completion, vision, tools and thinking. That is the quickest way to check whether a model supports tools or images before you wire it into an app.

How to delete or remove a model

ollama rm qwen3.5:2b

Use the exact name from ollama list, including the tag. If the name is wrong you get Error: model 'name' not found, which is what the test PC returned for a made-up name. Removing a model frees the disk space; to free memory without deleting anything, use ollama stop instead. To uninstall a model through the API, send DELETE /api/delete with {"model": "name"}.

How to update Ollama and update models

Updating Ollama itself: on Windows and macOS the app downloads updates by itself. Click the Ollama icon in the taskbar or menu bar and choose Restart to update, or download the installer again from ollama.com/download. On Linux, run the install script again:

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

Check the result with ollama -v. If the version printed by the command line and the server disagree, the old server is still running: quit the app or restart the service.

Updating a model: run ollama pull MODEL again. The pull fetches whatever the tag (for example gemma4:latest) currently points to in the library. The docs list no “update all” command; pull each model in ollama list that you want refreshed.

Is my model running on the GPU? (ollama ps)

Run a prompt, then ollama ps while the model is still loaded. On the test PC, after one short answer from qwen3.5:2b:

NAME          ID              SIZE      PROCESSOR    CONTEXT    RUNNER      UNTIL
qwen3.5:2b    0689d44085e0    2.4 GB    100% GPU     4096       llamacpp    4 minutes from now

To see speed, add --verbose. For that same one-sentence answer the test PC reported a load time of 4.2 seconds (the model was not in memory yet) and a generation rate of about 108 tokens per second. A 2B model on an 8 GB card is a small test; bigger models are much slower, and the tokens-per-second page covers what to expect.

How to stop a model or keep it loaded

ollama stop MODEL unloads it at once. To change how long models stay in memory, set OLLAMA_KEEP_ALIVE on the server (for example 10m, 24h, -1 to keep it loaded forever, or 0 to unload after every answer). For a single session, ollama run MODEL --keepalive 30m does the same. Through the API, the keep_alive field on /api/generate or /api/chat overrides the server setting; sending only the model name with "keep_alive": -1 preloads it.

How to increase the context length

Ollama does not give a model its full context by default. The current documentation says it picks the default from your video memory: 4k tokens under 24 GB of VRAM, 32k from 24 to 48 GB, and 256k at 48 GB or more. That is why the 8 GB test card showed 4096. The docs recommend at least 64,000 tokens for coding tools, agents and web search.

A bigger context needs more memory. After changing it, run ollama ps again: if PROCESSOR drops below 100% GPU, the model now spills into system RAM. Setting OLLAMA_KV_CACHE_TYPE=q8_0 roughly halves the memory the context uses, with a very small loss in precision according to the docs.

Advertisement

Where Ollama stores models, and how to move them

SystemDefault model folder
WindowsC:\Users\%username%\.ollama\models
macOS~/.ollama/models
Linux (install script)/usr/share/ollama/.ollama/models

To keep models on another drive, set OLLAMA_MODELS to the new folder and restart Ollama. On Linux the ollama user must own that folder: sudo chown -R ollama:ollama /path/to/models. On Windows the installer can also be put elsewhere with OllamaSetup.exe /DIR="D:\Ollama".

How to set Ollama environment variables

Every server setting is an environment variable, and it only takes effect when Ollama starts.

ollama serve --help prints the full list for your version. The ones people change most:

VariableWhat it changes
OLLAMA_HOSTAddress and port. Default 127.0.0.1:11434 (this machine only).
OLLAMA_MODELSWhere models are stored.
OLLAMA_CONTEXT_LENGTHDefault context window (4k, 32k or 256k depending on VRAM).
OLLAMA_KEEP_ALIVEHow long models stay loaded. Default 5 minutes.
OLLAMA_NUM_PARALLELRequests each model handles at once. Each one adds context memory.
OLLAMA_MAX_LOADED_MODELSHow many models can be loaded at the same time.
OLLAMA_FLASH_ATTENTION1 forces Flash Attention on, 0 turns it off. Automatic otherwise.
OLLAMA_KV_CACHE_TYPEf16 (default), q8_0 or q4_0 to shrink context memory.
OLLAMA_ORIGINSExtra web origins allowed to call the API (browser extensions, web apps).
OLLAMA_NO_CLOUD1 turns off cloud models and web search, for local-only use.
OLLAMA_DEBUG1 adds detail to the server log, including GPU detection.

The Ollama API: port 11434

Ollama’s server listens on http://localhost:11434. No API key is needed for a local install. Three quick checks:

curl http://localhost:11434/api/version
curl http://localhost:11434/api/tags
curl http://localhost:11434/api/generate -d '{"model":"qwen3.5:2b","prompt":"Why is the sky blue?","stream":false}'

/api/version returned {"version":"0.40.18"} on the test PC, and /api/tags returns the same models as ollama list. Ollama also answers OpenAI-style requests under /v1 (for example /v1/models and /v1/chat/completions), so most apps that accept a custom OpenAI base URL work with http://localhost:11434/v1. In PowerShell, curl may be an alias; use curl.exe or Invoke-WebRequest.

How to use Ollama from another computer

By default Ollama only accepts connections from the same machine. Set OLLAMA_HOST=0.0.0.0:11434 and restart it to listen on your network, then point the other device at http://THE-PC-IP:11434. There is no login on the local API, so keep it on your home network or behind a reverse proxy or VPN rather than opening the port to the internet. For a self-hosted chat front end on top, see the local LLM hub.

Common Ollama errors and fixes

Error: listen tcp 127.0.0.1:11434: bind: Only one usage of each socket address ... is normally permitted
You ran ollama serve while Ollama was already running (the desktop app or the service). This exact message appeared on the test PC. Nothing is broken: skip ollama serve and just use ollama run. If you need the server with different settings, quit the app first.

Error: model 'NAME' not found
The name or tag does not match anything installed. Copy it exactly from ollama list, or ollama pull it first.

The model runs on the CPU, or is very slow
Check ollama ps. If it shows a CPU share, the model plus its context does not fit in video memory: choose a smaller model or quantisation, or lower the context. If it shows 100% CPU on a machine with a supported NVIDIA card, update the driver (the Windows docs list 551.61 or newer) and look at the server log for GPU discovery errors. In Docker on Linux, GPU access needs the NVIDIA Container Toolkit.

503 overloaded
Too many requests are queued. Raise OLLAMA_MAX_QUEUE (default 512) or send fewer requests at once.

Squares instead of a progress bar on Windows 10
Older console fonts cannot draw the characters Ollama uses. Change the terminal font, or use Windows Terminal.

Where are the logs?
Windows: %LOCALAPPDATA%\Ollama\server.log (press Win+R and run explorer %LOCALAPPDATA%\Ollama). macOS: ~/.ollama/logs/server.log. Linux: journalctl -u ollama --no-pager --follow --pager-end. Set OLLAMA_DEBUG=1 for more detail.

How to uninstall Ollama

Windows: Settings, Apps, Installed apps, Ollama, Uninstall. If you moved models with OLLAMA_MODELS, that folder is left behind; delete it yourself. The default model folder is %HOMEPATH%\.ollama.

Linux (install script):

sudo systemctl stop ollama
sudo systemctl disable ollama
sudo rm /etc/systemd/system/ollama.service
sudo rm -r $(which ollama | tr 'bin' 'lib')
sudo rm $(which ollama)
sudo userdel ollama
sudo groupdel ollama
sudo rm -r /usr/share/ollama

The last line deletes every downloaded model, so copy anything you want to keep first.

FAQ

How do I see all Ollama commands?
ollama --help lists them, and ollama COMMAND --help shows the flags for one, for example ollama run --help.

What is the difference between ollama stop and ollama rm?
stop frees memory and keeps the files. rm deletes the files from disk.

Does Ollama need an API key?
Not for models running on your own machine. Signing in (ollama signin) is only for Ollama’s cloud models and for publishing models.

Does Ollama send my prompts anywhere?
The FAQ says local models run entirely on your machine and Ollama does not see the prompts. Cloud models are processed on Ollama’s servers. OLLAMA_NO_CLOUD=1 turns cloud features off.

How do I install a pre-release?
On Windows PowerShell: $env:OLLAMA_CHANNEL = "preview"; irm "https://ollama.com/install.ps1?channel=preview" | iex. On macOS or Linux: curl -fsSL 'https://ollama.com/install.sh?channel=preview' | OLLAMA_CHANNEL=preview sh.

Sources

Related guides

Updated: 30 November 2026 (Ollama 0.40.18 tested, 0.40.19 current). Written with AI help from the sources listed.

Advertisement