---
slug: ollama
kind: runbook
status: docs-checked
sh: https://insidethemachine.ai/install/ollama.sh
ps1: https://insidethemachine.ai/install/ollama.ps1
json: https://insidethemachine.ai/install/ollama.json
page: https://insidethemachine.ai/setups/ollama
---

# Install: Ollama

The one-command local model runner with a REST API on port 11434.

**Run status: Not run: commands checked against the official docs only.** Commands checked against the official docs on 2026-10-15. Not run end to end.

**This script:** The wrapper scripts are generated from the site data. Every .sh passed bash -n and shellcheck and ran in plan mode on Linux (Debian 13). Every .ps1 passed the PowerShell parser and chat.ps1 ran in plan, verify and rollback mode under PowerShell 7 on Linux with Windows calls mocked. Not run on macOS or real Windows.

**Run through this script:** 2026-10-16, Debian 13 box (no GPU, no systemd): the script installed Ollama for real. Checks: version PASS; API checks FAIL until `ollama serve` runs (no systemd); with the server up, tags PASS.

## One command

```bash
curl -fsSL https://insidethemachine.ai/install/ollama.sh | bash
```

Windows (PowerShell):

```powershell
irm https://insidethemachine.ai/install/ollama.ps1 | iex
```

Actions: `| bash -s -- plan` (print only), `verify`, `rollback --yes`. Env: ITM_RAM. Read the script first: `curl -fsSL https://insidethemachine.ai/install/ollama.sh | less`.

Lines marked YOU RUN are not run by the script (servers, interactive apps, your own files). The script prints them at the end, in order.

## Steps

### macOS

Install:

1. **Install Ollama**
   - run: `curl -fsSL https://ollama.com/install.sh | sh`
   - note: alternatives: brew install ollama   |   brew install --cask ollama-app   |   download https://ollama.com/download/Ollama.dmg
2. **Configure (your choices)**
   - YOU RUN (example model name used in the README; pick any model from ollama.com/library): `ollama pull gemma4`
   - YOU RUN (interactive chat): `ollama run gemma4`

Verify:

- `ollama --version` → expect: prints a version string
- `curl -s http://localhost:11434/api/tags` → expect: JSON list of locally pulled models
- `curl -s http://localhost:11434/api/chat -d '{"model":"gemma4","messages":[{"role":"user","content":"hi"}],"stream":false}'` → expect: JSON with message.content

Rollback:

- run: `ollama rm gemma4`
- run (macOS only): `brew uninstall ollama   # or: brew uninstall --cask ollama-app`
- run: `rm -rf ~/.ollama`

### Linux

Install:

1. **Install Ollama**
   - run: `curl -fsSL https://ollama.com/install.sh | sh`
2. **Configure (your choices)**
   - YOU RUN (example model name used in the README; pick any model from ollama.com/library): `ollama pull gemma4`
   - YOU RUN (interactive chat): `ollama run gemma4`

Verify:

- `ollama --version` → expect: prints a version string
- `curl -s http://localhost:11434/api/tags` → expect: JSON list of locally pulled models
- `curl -s http://localhost:11434/api/chat -d '{"model":"gemma4","messages":[{"role":"user","content":"hi"}],"stream":false}'` → expect: JSON with message.content

Rollback:

- run: `ollama rm gemma4`
- run (macOS only): `brew uninstall ollama   # or: brew uninstall --cask ollama-app`
- run: `rm -rf ~/.ollama`

### Windows (PowerShell, not run by us)

Install:

1. **Install Ollama**
   - run: `irm https://ollama.com/install.ps1 | iex`

Verify:

- `ollama --version` → expect: prints a version string
- by hand: `curl -s http://localhost:11434/api/tags` → expect: JSON list of locally pulled models
- by hand: `curl -s http://localhost:11434/api/chat -d '{"model":"gemma4","messages":[{"role":"user","content":"hi"}],"stream":false}'` → expect: JSON with message.content

Rollback:

- run: `ollama rm gemma4`
- YOU RUN (macOS/Linux command; do the same by hand): `brew uninstall ollama   # or: brew uninstall --cask ollama-app`
- YOU RUN (macOS/Linux command; do the same by hand): `rm -rf ~/.ollama`
