What you’ll build

This tutorial shows a practical, beginner-friendly path to installing OpenClaw and running it with Ollama as the local model runtime. By the end, you’ll have Ollama working, OpenClaw installed, and a quick way to confirm everything is connected correctly.

Prerequisites

  • A supported OS: macOS, Linux, or Windows (steps vary slightly by platform).
  • Ollama installed (or permission to install apps on your machine).
  • Terminal access: macOS Terminal, Windows Terminal/PowerShell, or a Linux shell.
  • Disk space: model files can be large; plan for several GB.

Step 1: Install and verify Ollama

First install Ollama using the method recommended for your operating system (installer/app on macOS/Windows, package/script on Linux). After installing:

  1. Confirm Ollama runs by checking its version or basic command output in your terminal.

  2. Start the Ollama service (on some systems it starts automatically). If it doesn’t, launch it from your applications list or use the platform’s service manager.

Sanity check: try pulling a small model and running a simple prompt via Ollama. If a model downloads and you can generate text, Ollama is ready for OpenClaw.

Step 2: Get OpenClaw

OpenClaw can be installed in different ways depending on how it’s distributed (for example: cloning a repository, downloading a release, or installing via a package manager). Use the official installation path provided by the project, then place OpenClaw in a folder where you can easily run it.

Tip: If you’re using a repo-based install, keep the folder name simple (no special characters) to reduce path issues across platforms.

Step 3: Configure OpenClaw to use Ollama

The key concept is that OpenClaw needs to know how to reach Ollama. Typically this means setting one or more configuration values such as:

  • Provider/runtime: set to ollama (or the equivalent option in OpenClaw).
  • Base URL: the local Ollama endpoint (commonly a localhost address/port).
  • Model name: the Ollama model you pulled (the identifier must match what Ollama recognizes).

Where do you set this configuration?

  • Config file (common for apps): a JSON/YAML/TOML file inside the OpenClaw directory.
  • Environment variables (common for CLI tools): values exported in your shell profile or set for a single session.
  • CLI flags (common for command-line apps): options passed at runtime.

Step 4: First run test

Run OpenClaw and execute a minimal request (for example: a short “hello” prompt). What you’re looking for is:

  • OpenClaw starts without errors
  • It detects the Ollama backend
  • It returns a response generated by the model

Practical verification: open the logs/console output and confirm it reports the selected model/provider and that tokens are being generated rather than timing out.

Common issues and fixes

1) “Connection refused” / can’t reach Ollama

  • Cause: Ollama service isn’t running, or OpenClaw is pointing to the wrong host/port.
  • Fix: start Ollama, then verify the endpoint address in OpenClaw’s configuration.

2) Model not found

  • Cause: OpenClaw references a model name that isn’t installed in Ollama.
  • Fix: pull the model via Ollama and update OpenClaw’s model setting to match exactly.

3) Slow generation or high resource usage

  • Cause: The chosen model is too large for your hardware, or you’re using default settings that aren’t optimized.
  • Fix: try a smaller model, reduce context length if configurable, and close other heavy applications.

4) Windows-specific path/permission problems

  • Cause: execution policy restrictions, blocked downloads, or protected install locations.
  • Fix: install to a user-writable directory, run the terminal with appropriate permissions, and ensure downloaded files are unblocked when needed.

Next steps

  • Switch models: experiment with different Ollama models to balance speed vs. quality.
  • Create a reusable profile: store your working configuration in a dedicated config file or environment script.
  • Add tooling: integrate OpenClaw into your editor, scripts, or automation workflows once the basics are stable.

If you get stuck, capture (1) your OS, (2) the OpenClaw config values for provider/base URL/model, and (3) the exact error message—those three details usually pinpoint the problem quickly.