Ollama Commands Cheat Sheet: run, pull, ls, ps, stop, rm, create, serve and launch
Note: Some future links on this site may be affiliate links. We never claim hands-on testing; guides are researched from the public sources listed in each article.
How we wrote this: A summary of Ollama's official CLI Reference and FAQ (linked below), checked October 29, 2026. Model names in the examples are the ones Ollama's docs use; swap in any model you've downloaded. Commands can change between Ollama versions;
ollama --helpon your machine is the final word.
Once Ollama is installed, almost everything happens through a handful of terminal commands. Ollama's CLI reference lists them; this page groups them by job and adds the details from the FAQ that explain what you're looking at. New to Ollama? Start with running your first local model.
The short version
| Command | What it does |
|---|---|
ollama run <model> |
Chat with a model (downloads it first if needed) |
ollama pull <model> |
Download a model without starting it |
ollama ls |
List downloaded models |
ollama ps |
List models loaded in memory right now |
ollama stop <model> |
Unload a running model |
ollama rm <model> |
Delete a downloaded model |
ollama create -f Modelfile |
Build a customized model |
ollama serve |
Start the Ollama server yourself |
ollama launch |
Set up and start a supported coding app |
ollama signin / signout |
Sign in to or out of ollama.com |
Running and chatting
ollama run gemma4
That opens an interactive chat. For a prompt that spans several lines, the docs show wrapping it in triple quotes:
>>> """Hello,
... world!
... """
ollama run also handles other kinds of models, per the reference:
- Images (multimodal models): put the file path in the prompt, for example
ollama run gemma4 "What's in this image? ./photo.png". - Embeddings:
ollama run embeddinggemma "Hello world"prints a JSON array of numbers. See embeddings and semantic search. - Decision models:
ollama run nimble --ask "..."answers yes/no, label or score questions about text. See our decision models guide. - Speech models:
ollama run phonon "Hello from Ollama."plays audio, or writes a WAV file if you redirect output. See Ollama text-to-speech.
Downloading, listing and deleting
ollama pull gemma4
ollama ls
ollama rm gemma4
pull is handy when you want to download overnight and chat later. rm frees disk space; models are large, so it's worth running ollama ls now and then. The FAQ says models are stored in ~/.ollama/models on macOS, /usr/share/ollama/.ollama/models on Linux, and C:\Users\%username%\.ollama\models on Windows. You can move them by setting the OLLAMA_MODELS environment variable.
What's loaded, and on which chip
ollama ps
This lists models currently in memory. The FAQ explains the PROCESSOR column:
- 100% GPU: the model is entirely in GPU memory.
- 100% CPU: it's entirely in system memory.
- A split such as 48%/52% CPU/GPU: it's partly in each, which is usually slower.
The UNTIL column shows when it will be unloaded. By default the FAQ says models stay loaded for 5 minutes after use. To free memory immediately:
ollama stop gemma4
Not sure whether a model will fit at all? Our AI model memory calculator estimates it, and GPU support covers which cards Ollama uses.
Customizing a model
Write a Modelfile, for example:
FROM gemma4
SYSTEM """You are a happy cat."""
Then build it:
ollama create -f Modelfile
Our Modelfile guide covers the other instructions.
Running the server yourself
The desktop apps start the server for you. On a headless machine, or to test settings, start it directly:
ollama serve
The reference says ollama serve --help lists the environment variables you can set, such as OLLAMA_HOST, OLLAMA_MODELS and OLLAMA_CONTEXT_LENGTH. The FAQ explains how to set them permanently on each system (launchctl on a Mac, systemctl edit on Linux, the Environment Variables settings on Windows). For context length specifically, see context length explained.
Launching coding tools
ollama launch
launch configures and starts supported apps to use your Ollama models. The reference lists OpenCode, Claude Code, Codex, VS Code and Droid. Examples from the docs:
ollama launch claude
ollama launch claude --model qwen3.5
ollama launch droid --config
The last one configures without launching. For the VS Code route specifically, see Ollama in VS Code chat.
Signing in (optional)
ollama signin
ollama signout
You don't need an account to run models locally. Per the FAQ, signing in links your machine's Ollama public key to ollama.com, which is needed to push models, pull private models, or use Ollama's cloud-hosted models. If you want to stay strictly local, see keeping Ollama local-only.
When something goes wrong
If a command hangs, a model won't load, or ollama ps shows CPU when you expected GPU, the server log is the place to look. See Ollama troubleshooting and logs.