Shipping an AI app or agent? Security review in 1 working day: $149 / ₹13,900. Request a review →
AI Review Ready
Home / Error fixes / ollama: command not found
Fix · Ollama · install

ollama: command not found: put it on your PATH

Fix: open a new terminal first. Still not found on a Mac? Link the command: sudo ln -s /Applications/Ollama.app/Contents/Resources/ollama /usr/local/bin/ollama. On Windows, %LOCALAPPDATA%\Programs\Ollama must be on your PATH; in WSL or Docker, install or run it inside that environment.

Fix it

  1. Open a new terminal (and restart your editor if you use its terminal). A window opened before the install keeps the old PATH.
  2. Make sure you installed it in this environment. WSL, Docker containers and SSH sessions are separate from the desktop you installed on.
  3. Find the binary and add its folder to PATH (per-OS steps below).
  4. Confirm: ollama -v prints the version.

The messages

ShellMessage
bashollama: command not found
zsh (macOS default)zsh: command not found: ollama
PowerShellollama : The term 'ollama' is not recognized as the name of a cmdlet, function, script file, or operable program.
CMD'ollama' is not recognized as an internal or external command, operable program or batch file.

Windows

Install from PowerShell (or download OllamaSetup.exe):

irm https://ollama.com/install.ps1 | iex

This line is PowerShell. In Command Prompt (CMD) it fails with 'irm' is not recognized: why, and how to run it.

The installer needs no Administrator rights, installs into your home folder, and adds %LOCALAPPDATA%\Programs\Ollama to your user PATH. Check the file is there:

Test-Path "$env:LOCALAPPDATA\Programs\Ollama\ollama.exe"

True but still not found: open a new terminal; if that fails, add the folder to your user PATH under Settings → "Edit environment variables for your account". False: if you installed with OllamaSetup.exe /DIR="d:\some\location", use that folder instead; otherwise reinstall. Ollama needs Windows 10 22H2 or newer.

macOS

Install with curl -fsSL https://ollama.com/install.sh | sh or by dragging Ollama from Ollama.dmg into Applications. On startup, the app checks whether the ollama command is on your PATH and, if not, asks permission to create a link in /usr/local/bin. If you declined, or moved the app, the command lives inside the app bundle at Ollama.app/Contents/Resources/ollama. Link it yourself:

sudo ln -s /Applications/Ollama.app/Contents/Resources/ollama /usr/local/bin/ollama

Ollama needs macOS Sonoma (14) or newer.

Linux

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

The manual install extracts the package into /usr (curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst | sudo tar x -C /usr; ARM64 has its own package). Then start the server with ollama serve and check from another terminal with ollama -v.

WSL

A WSL terminal is a Linux shell with its own PATH, so an Ollama installed on the Windows side isn't on it. Run the Linux install command inside your WSL distribution.

Docker

With the official image, the command exists inside the container, not on your host. Run it through Docker:

docker exec -it ollama ollama run llama3.2

(ollama here is the container name from docker run ... --name ollama ollama/ollama.)

Found, but it can't connect

If ollama runs but can't reach a server, the app or ollama serve isn't running. The API is served on http://localhost:11434 by default.

Running Claude Code, Codex or Cursor on real repos, or shipping an AI agent? A Quick Review ($149 / ₹13,900, 1 working day) checks one repo, config or setup for leaked keys, risky agent permissions and MCP servers. Request a Quick Review

FAQ

Where does Ollama install on Windows?

In your home folder by default: the binaries are in %LOCALAPPDATA%\Programs\Ollama, which the installer adds to your user PATH. Models and configuration are in %HOMEPATH%\.ollama.

Where is the ollama command on a Mac?

Inside the app bundle at Ollama.app/Contents/Resources/ollama. The app offers to link it into /usr/local/bin on first start.

How do I fix zsh: command not found: ollama on a Mac?

Open a new terminal first. If it still fails, the ollama command isn't linked onto your PATH (for example, you declined the app's offer to link it, or moved the app). Link it yourself: sudo ln -s /Applications/Ollama.app/Contents/Resources/ollama /usr/local/bin/ollama, then check with ollama -v.

Can I use the Windows Ollama from WSL?

Ollama's docs give a separate Linux install; inside WSL, run the Linux install command in your distribution.

Does installing Ollama on Windows need admin rights?

No. The Windows docs say the install doesn't require Administrator and goes into your home directory by default.

Related errors

Sources

Read 29 Nov 2026. These tools change often: if a step no longer matches, the linked page wins.

Related free tools