Skip to content
local-ai
Beginner

Ollama commands: a practical reference

The Ollama commands you actually reach for: listing, running, and removing models, finding and changing where they are stored, the default port and how to change it, updating, and uninstalling cleanly on macOS, Windows, and Linux.

By Leon Mallett

What you’ll learn

The handful of Ollama commands most people need, each with the exact command and a line on what it does. Commands and paths below were checked against Ollama’s documentation in October 2026; this ecosystem moves quickly, so confirm anything surprising against the current docs.

The commands at a glance

Command What it does
ollama serve Start the Ollama server (listens on port 11434)
ollama run <model> Download if needed, then chat with a model
ollama pull <model> Download a model without running it
ollama list List the models you have downloaded
ollama ps Show models currently loaded in memory
ollama stop <model> Unload a running model from memory
ollama rm <model> Delete a downloaded model and reclaim its space
ollama show <model> Show a model’s details (size, context, licence)

Starting the server, and the default port

ollama serve starts the background server. On macOS and Windows the desktop app starts it for you; ollama serve is mainly for Linux or for running it by hand. It listens on port 11434 by default, and exposes an OpenAI-compatible API at http://localhost:11434 that other tools can talk to.

To change the port, or to let other devices on your network reach it, set the OLLAMA_HOST environment variable before starting the server. Its default is 127.0.0.1:11434; setting 0.0.0.0:11434 binds it to all interfaces so other machines can connect. Treat that with care: it exposes the model API to your network, so only do it on a network you trust.

Listing, running, and removing models

  • ollama list shows what you have downloaded, with sizes.
  • ollama run <model> runs one, pulling it first if you do not have it.
  • ollama rm <model> removes one and frees the disk space it used.

Model names include a tag, for example llama3.2:3b; ollama list shows the exact names you can pass to run and rm.

Where models are stored, and reclaiming space

Downloaded models can take a lot of disk. They live in:

  • macOS: ~/.ollama/models
  • Linux: /usr/share/ollama/.ollama/models (when Ollama runs as a service), or ~/.ollama/models
  • Windows: C:\Users\<username>\.ollama\models

ollama rm <model> is the clean way to reclaim space. To move the store elsewhere (a bigger drive, say), set the OLLAMA_MODELS environment variable to the new path and restart the server.

Updating Ollama

  • macOS and Windows: the desktop app updates itself, or download the latest from ollama.com; there is no update command.
  • Linux: re-run the install script, curl -fsSL https://ollama.com/install.sh | sh.

Uninstalling cleanly

Removing the app does not remove the models, which are often the bulk of the disk use, so delete the model directory above as well if you want the space back.

  • macOS: quit Ollama, delete /Applications/Ollama.app, remove the CLI with sudo rm /usr/local/bin/ollama, and delete ~/.ollama for the models and config.
  • Windows: quit Ollama from the system tray, then uninstall it from Settings, and delete C:\Users\<username>\.ollama.
  • Linux: stop and disable the service, then remove its files:
    sudo systemctl stop ollama
    sudo systemctl disable ollama
    sudo rm /etc/systemd/system/ollama.service
    sudo rm $(which ollama)
    sudo rm -r /usr/share/ollama

Next steps

Related tools

Next in this topic llama.cpp vs Ollama vs vLLM: which engine?

Last updated 1 October 2026.