Web Asset House Guides
Local AI

Ollama Commands Cheat Sheet: run, pull, ls, ps, stop, rm, create, serve and launch

By Web Asset House Studio ·

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 --help on 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:

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:

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.

Sources

← All Local AI guides · All guides