Ollama Commands: The Cheat Sheet for Mac Users, With Port and Uninstall

A person at a wooden desk by a window using a laptop with code on screen, beside handwritten notes and a cup of tea.

By Annie Vane · Local · Mac · Cheat sheet · Docs-only · Checked October 22, 2026

Every command below comes from the Ollama documentation or the Ollama source code on GitHub, checked October 22, 2026.

Ollama has about fifteen terminal commands and you will use five of them nearly every day: ollama list shows what is installed, ollama ps shows what is loaded in memory, ollama pull and ollama run fetch a model and start a chat, and ollama rm deletes one. On a Mac the server is the menu-bar app, it listens on port 11434, and you update it by clicking the menu-bar icon and choosing "Restart to update". This page is the cheat sheet. The Ollama guide covers installing it and choosing a model, and the troubleshooting page covers what to do when a command fails.

Ollama logo
Image: Ollama

For the full guide, see How to Delete Ollama Models and Free Up Disk Space, or Remove Ollama Completely.

The ten Ollama commands you use most

Open Terminal (it is in Applications, then Utilities) and type any of these. Replace the model name with one from the Ollama models list. The examples use gemma4, as the Ollama documentation does.

Ollama commands in the official CLI Reference: the documentation page showing ollama run gemma4, ollama launch and the list of supported coding integrations
The CLI Reference in Ollama's documentation, October 23, 2026. Screenshot: docs.ollama.com.
CommandWhat it does
ollama run gemma4Downloads the model if you do not have it, then starts a chat in the terminal. Type /bye to leave.
ollama pull gemma4Downloads a model without starting a chat.
ollama listLists every model installed on your Mac, with its size on disk. ollama ls does the same.
ollama psLists the models loaded in memory right now, and whether they are on the GPU.
ollama stop gemma4Unloads a model from memory. It stays on disk.
ollama rm gemma4Deletes a model from disk.
ollama show gemma4Shows a model's details: architecture, parameters, context length and more.
ollama serveStarts the Ollama server in the terminal. On a Mac you normally let the menu-bar app do this instead.
ollama -vPrints the version and warns you if no server is running.
ollama launch claudeConnects a coding agent such as Claude Code to your Ollama models.

The rest of the set is ollama create (build a model from a Modelfile), ollama cp (copy a model to a new name), ollama push (publish a model to ollama.com), and ollama signin and ollama signout for Ollama Cloud. Typing ollama on its own opens a setup menu, and ollama serve --help lists every environment variable the server understands.

Ollama CLI reference page listing ollama run and ollama launch, 27 November 2026
Screenshot: Ollama CLI reference, taken November 27, 2026. Source: docs.ollama.com.

See what is installed and what is running

To check which models are installed:

ollama list

You get a table with NAME, ID, SIZE and MODIFIED columns. The SIZE column is the space the model takes in ~/.ollama/models, which is where Ollama keeps everything on a Mac. Installed is not the same as running, though. A model on disk uses no memory until you ask it something. To see what is actually loaded:

ollama ps

The PROCESSOR column tells you whether the model is on the GPU. "100% GPU" means it fits entirely in graphics memory, "100% CPU" means it is in system memory, and a split such as "48%/52% CPU/GPU" means it is partly in each. On an Apple silicon Mac the GPU uses the same unified memory as everything else, and Ollama uses it through Metal. The CONTEXT column shows the context length the model was loaded with, and UNTIL shows when it will be unloaded; by default that is five minutes after the last request.

Unless you change it, that context length depends on how much memory the GPU can use: 4k tokens below 24 GiB, 32k from 24 to 48 GiB and 256k from 48 GiB, according to Ollama's context length guide. On a Mac the GPU's share comes out of unified memory, so a 16GB Mac gets the 4k default. To raise it for every model, use the context length slider in the app's settings; for one chat, use /set parameter num_ctx, covered below.

For details of one model, use ollama show gemma4. Add a flag to see one part of it: --modelfile, --parameters, --system, --template or --license. The same information is available from the local API, which is handy if you are checking from a script:

curl http://localhost:11434/api/tags
curl http://localhost:11434/api/ps

On a Mac, if you run one of these commands while the app is closed, the current source code has the command line open the app and wait for the server before answering.

Download, run and talk to a model

To add a model, pull it by name. Names come from the library at ollama.com, and a colon adds a tag for a particular size. The quickstart uses the small Gemma 4 model:

ollama pull gemma4:e2b

That download is about 7.2GB, and Ollama recommends 8GB of unified memory on a Mac for it. Bigger models need more; check a model against your Mac with the memory calculator before you pull it. You can skip the pull step entirely, because ollama run downloads a missing model first:

ollama run gemma4:e2b

You are now in a chat. Type a question, press Return, and type /bye when you have finished. To ask one question without opening a chat, put the prompt after the model name; the documentation's examples include an image for a vision model:

ollama run gemma4 "Why is the sky blue?"
ollama run gemma4 "What's in this image? /Users/jmorgan/Desktop/smile.png"

Inside a chat, lines that start with a slash are commands for Ollama rather than questions for the model. These are the ones built into the current release:

  • /set changes session settings. /set parameter num_ctx 8192 raises the context length for this chat, /set system "..." sets a system message, /set verbose shows timings, and /set think or /set nothink toggles thinking on models that support it.
  • /show shows model information: /show info, /show parameters, /show system, /show template, /show modelfile and /show license.
  • /save my-model saves the current session, including any system message you set, as a new model you can run later. /load my-model loads one.
  • /clear wipes the conversation so far, /bye leaves, and /? lists everything, with /? shortcuts for the keyboard shortcuts.

For a multi-line prompt, start and end it with three double quotes. Two run flags are worth knowing too: --verbose prints the timings for each answer, including the "eval rate" in tokens per second, which is the quickest way to judge whether a model suits your Mac, and --keepalive 30m keeps the model in memory for longer than the default five minutes.

Delete a model and free the disk

Use the exact name from ollama list, including the tag after the colon:

ollama rm gemma4:e2b

Ollama prints "deleted 'gemma4:e2b'" and the space comes back right away. You can list several models in one go, and the command unloads a running model first. There is no separate "delete" or "remove" command; rm is the one. Use it rather than deleting files from ~/.ollama/models in the Finder, so Ollama's own list stays in step with what is on disk.

The same thing from a script or another app goes through the API:

curl -X DELETE http://localhost:11434/api/delete -d '{
  "model": "gemma4"
}'

If the problem is not one model but your Mac's small internal drive, you can move the whole models folder to an external disk by setting OLLAMA_MODELS to the new path, using the launchctl method described in the port section below, and restarting the app.

Stop, start and restart Ollama on a Mac

"Stop Ollama" means two things. The first is unloading a model from memory while the server keeps running. Ollama does this by itself five minutes after the last request, or you can do it now:

ollama stop gemma4

The second is quitting the server itself. On a Mac the server is the Ollama app, which lives in the menu bar at the top right of the screen. Click its icon and quit it from the menu, exactly as you would any other menu-bar app. If you started the server yourself by typing ollama serve in Terminal, press Ctrl+C in that window instead.

To start it again, open Ollama from the Applications folder. You only need one copy: if the app is running and you also type ollama serve, the second one fails with an "address already in use" error on port 11434, which the troubleshooting page explains. A restart is simply quit then open, and you need one after changing any setting with launchctl.

Ollama registers itself as a login item when you install it, so it starts when you log in. If you would rather start it by hand, open System Settings, search for "Login Items", find Ollama under "Allow in the Background" and turn the switch off. Ollama keeps that choice across updates.

Which port Ollama uses and how to change it

Ollama listens on port 11434, and only on your own Mac (the address 127.0.0.1), so nothing else on your network can reach it unless you change that. The API lives at http://localhost:11434/api, and an OpenAI-compatible version at http://localhost:11434/v1, which is the address you give to apps such as Open WebUI or a coding tool. The local API has no password or key.

The quickest way to check if Ollama is running is to ask that port a question. The server answers the plain root address with the words "Ollama is running", and the version endpoint tells you which release you are on:

curl http://localhost:11434
curl http://localhost:11434/api/version

If curl reports "Connection refused", the app is not running. ollama -v does the same check from the other direction: it prints the version if it can reach a server and "Warning: could not connect to a running Ollama instance" if it cannot.

To change the port, or to let other devices on your network use your Mac's models, set the OLLAMA_HOST variable. Because the Mac app is launched by the system rather than by your shell, the documented way is launchctl, followed by a restart of the app:

launchctl setenv OLLAMA_HOST "0.0.0.0:11434"

That example, from the Ollama FAQ, keeps port 11434 but opens it to every device on the network; to move the port instead, change the number, for example "127.0.0.1:11435". The local API has no authentication, so only open it on a network you trust. To undo it, run launchctl unsetenv OLLAMA_HOST and restart the app. The ollama command reads the same variable to find the server, so it needs the new address too.

Update Ollama

On a Mac, Ollama downloads updates by itself. When one is ready, click the menu-bar icon and choose "Restart to update". If you would rather not wait, download the current Ollama.dmg from ollama.com/download and drag the app over the old one. Either way your models stay where they are in ~/.ollama/models; only the uninstall steps below remove that folder.

To see which version you have, and whether the server is up:

ollama -v

As of October 22, 2026 the current release is v0.40.8, published on October 21. If you installed the command-line version with Homebrew instead of the app, update it with brew upgrade ollama; the Homebrew formula was also on 0.40.8 when I checked. The Homebrew formula installs the ollama binary and runs the server with brew services start ollama, so it has no menu-bar app to update itself.

Uninstall Ollama completely on a Mac

Dragging the app to the Bin leaves the command-line link, the settings and every downloaded model behind. The macOS documentation lists everything to remove. Quit the menu-bar app first, then run these in Terminal:

Check before you run

  • Run ls ~/.ollama/models first, to see what is there.
  • Back up anything you want to keep. The ~/.ollama folder holds all your models and your Ollama key.
  • Never paste a command that contains a path you do not recognize. rm -rf and sudo rm delete right away, with no Bin to recover from.
sudo rm -rf /Applications/Ollama.app
sudo rm /usr/local/bin/ollama
rm -rf "~/Library/Application Support/Ollama"
rm -rf "~/Library/Saved Application State/com.electron.ollama.savedState"
rm -rf ~/Library/Caches/com.electron.ollama/
rm -rf ~/Library/Caches/ollama
rm -rf ~/Library/WebKit/com.electron.ollama
rm -rf ~/.ollama

The last line deletes ~/.ollama, which holds all your models and your Ollama key, so leave it out if you plan to reinstall. The two lines with a tilde inside double quotes are copied exactly from the documentation, but the zsh manual says only an unquoted tilde is expanded to your home folder. If either line reports "No such file or directory", run it with the tilde outside the quotes, for example rm -rf ~/Library/"Application Support"/Ollama. If you installed with Homebrew, brew uninstall ollama removes that copy.

Prefer Finder to Terminal? Quit the menu-bar app, then drag Ollama from the Applications folder to the Bin. In Finder, choose Go, then Go to Folder (Shift-Command-G), and look in ~/Library/Application Support and ~/Library/Caches for items named Ollama or com.electron.ollama, and in ~/Library/WebKit for com.electron.ollama. Your models are in the hidden ~/.ollama folder; press Shift-Command-full stop in Finder to show hidden files. The command-line link in /usr/local/bin is easier to remove in Terminal.

Make your own model variant

A Modelfile is a short text file that says which model to start from and how to change it: a system message, a default temperature, a longer context. Save this as a file called Modelfile; it is the example from the CLI reference:

FROM gemma4
SYSTEM """You are a happy cat."""

Then build it under a name of your choosing and run it like any other model:

ollama create happy-cat -f Modelfile
ollama run happy-cat

The -f flag points at the file and defaults to a file called Modelfile in the current folder. The instructions you can use are FROM (required), PARAMETER, TEMPLATE, SYSTEM, LICENSE, MESSAGE, REQUIRES and CAPABILITY. The two parameters worth setting are temperature, where the default is 0.8 and lower is more predictable, and num_ctx for the context length, written as PARAMETER num_ctx 8192 on its own line.

To see how a library model is put together before you change it, print its Modelfile with ollama show --modelfile gemma4. To keep a copy under another name, ollama cp gemma4 gemma4-backup. And if you only want a system message, you do not need a file at all: set it in a chat with /set system and then /save a name. Publishing a variant to ollama.com with ollama push needs you to sign in first, which is the next section.

Ollama Cloud commands and API keys

Ollama Cloud runs large models on Ollama's servers using the same commands and the same app. Nothing about local models needs an account; you only sign in to use cloud models, to publish a model or to pull a private one. From the terminal:

ollama signin
ollama run gemma4:cloud
ollama signout

In the app or CLI a cloud model's name ends in :cloud, and the download page says gemma4:cloud is included in the free plan while most other cloud models need a paid plan or purchased credits. Plans start at $20 a month for Pro, tax not mentioned; the Ollama Cloud page goes through the models, the prices and what happens to your prompts.

An API key is a different thing from signing in, and you only need one to call ollama.com directly from your own code, without an Ollama installation. There is no command that creates one: sign in at ollama.com, open Settings, then API keys (the address is ollama.com/settings/keys), and create a key there. Keys do not expire, and the same page revokes them. Put it in your shell, then use it as a bearer token:

export OLLAMA_API_KEY="your_api_key"
curl https://ollama.com/api/chat \
  -H "Authorization: Bearer $OLLAMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma4:31b",
    "messages": [{"role": "user", "content": "Why is the sky blue?"}],
    "stream": false
  }'

Keep the key out of browser code and source control. If you want a strictly local Ollama with no cloud features at all, set OLLAMA_NO_CLOUD=1 with launchctl, or put {"disable_ollama_cloud": true} in ~/.ollama/server.json, and restart. The coding-agent side of this, including ollama launch claude and the --model flag, is on the Claude Code with Ollama page.

Frequently asked questions

How do I check installed models in Ollama?

Open Terminal and type ollama list. It prints every model on your Mac with its name, size on disk and when it was last modified. To see which models are loaded in memory right now, and whether they are on the GPU, type ollama ps instead. From a script, the same lists come from http://localhost:11434/api/tags and /api/ps.

How do I delete or remove a model in Ollama?

Type ollama rm followed by the model's full name from ollama list, including the tag after the colon, for example ollama rm gemma4:e2b. You can name several models in one command. Ollama unloads the model if it is running, deletes it from ~/.ollama/models and frees the space immediately. There is no separate delete or remove command.

What port does Ollama use?

Ollama uses port 11434 on 127.0.0.1, which means only programs on your own Mac can reach it. Apps connect to http://localhost:11434, with the API under /api and an OpenAI-compatible API under /v1. To change the port or open it to your network, set OLLAMA_HOST with launchctl setenv and restart the Ollama app.

How do I check if Ollama is running?

Look for the Ollama icon in the menu bar, or type curl http://localhost:11434 in Terminal: a running server replies "Ollama is running", and a stopped one gives "Connection refused". The command ollama -v also checks, printing the version when it can reach the server and a warning that it could not connect when it cannot.

How do I update Ollama on a Mac?

The Mac app downloads updates by itself. Click the Ollama icon in the menu bar and choose "Restart to update" when it appears. You can also download the latest Ollama.dmg from ollama.com/download and drag it over the old app. Your downloaded models are kept either way, and ollama -v shows which version you are on afterwards.

How do I stop Ollama running, or restart it?

To unload one model but keep the server, type ollama stop followed by the model name. To stop the server itself on a Mac, click the Ollama icon in the menu bar and quit it, or press Ctrl+C if you started it with ollama serve in Terminal. To restart, open Ollama again from Applications. To stop it launching at login, turn Ollama off under Login Items in System Settings.

How much RAM does Ollama need?

Ollama itself needs very little; the model decides. Ollama's quickstart recommends 8GB of unified memory on a Mac for its 7.2GB Gemma 4 E2B download, and its context length guide says a longer context needs more memory on top of the model. As a rule a model needs at least its size from ollama list plus headroom for the context and for macOS. The memory calculator on this site checks a specific model against a specific Mac.

How do I get an Ollama API key?

Sign in at ollama.com, go to Settings and then API keys (ollama.com/settings/keys) and create one there; no terminal command makes a key. You only need a key to call Ollama Cloud directly from code at https://ollama.com/api, sent as an Authorization: Bearer header. Local models never need a key, and running cloud models from the app or terminal needs only ollama signin.

Sources

This page is reviewed monthly and was last checked on October 22, 2026. Your next step: run ollama list to see what is installed and how much disk it uses.

Spotted a mistake? Tell us

Annie Vane, author of Local AI Scout

ABOUT THE AUTHOR

Annie Vane

Annie edits Local AI Scout and tests the models she covers on her own 24 GB M5 MacBook Air. She has worked in search, affiliate marketing and digital publishing for national newspapers and magazine groups.

More about Annie and how we test

Keep exploring: Apps · Models · All guides

Good finds.
Less noise.

The Scout Letter: new guides, app reviews and "Can I run it?" checks on new models, in one short email every two weeks. No spam.

Free to join. Unsubscribe with one click.