Skip to the content.

Part of On Beginning. Steps 2 and 4 of 8.

Connect a local model with Ollama

For readers who want the model to run on their own computer. Do Part 1 before installing OpenClaw, and Part 2 during OpenClaw’s setup. Cloud users can skip this page.

Part 1: get one local model answering

  1. Download Ollama from its official site, install it, and open the app. On Linux, follow Ollama’s Linux installation instructions.
  2. Open Terminal on a Mac (press ⌘-Space and type “Terminal”), PowerShell from the Windows Start menu, or a terminal on Linux.
  3. Type each line below and press Return:

    ollama pull gemma4:e2b
    ollama list
    ollama run gemma4:e2b "Reply with exactly: Local model ready."
    
    • The first line downloads the model. This needs internet and can take a while.
    • The second lists your installed models. Your model’s exact name should appear.
    • The third asks the model a question. The first answer may be slow while the model loads.

These commands use gemma4:e2b, a small starting model. If you chose another model on Choose your setup, replace the name in all three lines and in OpenClaw’s settings later.

Avoid any model name that includes cloud (such as gemma4:31b-cloud). Those run on Ollama’s servers, not your computer.

Checkpoint: a model on your computer answered you. You haven’t yet tested whether it can use tools. That comes later.

Now go straight on and install OpenClaw for your Apple Silicon Mac, Intel Mac, or Windows computer. Ollama keeps a model in memory for a few minutes after you use it, and OpenClaw’s setup looks for models that are already loaded.

If nothing happens or your computer slows down, see Troubleshooting.

Part 2: choose Ollama during OpenClaw setup

When OpenClaw’s setup asks, choose:

  1. Custom setup, not Quick start.
  2. Ollama as the provider, then Local only.
  3. For the Ollama address (the base URL), enter:

    http://127.0.0.1:11434
    

    This works when Ollama and OpenClaw run directly on the same computer, with Ollama on its default port. Don’t add /v1 to the end. If your setup is different, see Troubleshooting.

  4. Select the exact model you downloaded.

OpenClaw then tests the model with a real request before saving it. Passing that test means the model can answer. It doesn’t yet prove the model handles tools well.

If your model isn’t listed, see Troubleshooting. Leave messaging apps and other add-ons unconfigured for now.

Check where your requests are going

Run:

openclaw models list --provider ollama
openclaw models status
openclaw models fallbacks list

models status shows your default model. A fallback is a backup model OpenClaw switches to if the main one fails. For a local-only setup, the default should be your local model, and the fallback list should be empty or contain only local models you chose deliberately.

If you need to set the default yourself:

openclaw models set ollama/gemma4:e2b

To remove every fallback (including any local ones), run this, then check the list again:

openclaw models fallbacks clear

If you later set up more than one agent, each can have its own model, so check each one.

Installing Ollama does not by itself make your setup local. Check both the selected model and the server it connects to.


Next: Start the assistant safely.

Related: Ollama · Runner · Local Model · Ollama setup in OpenClaw · Troubleshooting

Return to Dictionary All Entries (A–Z) For Students Other Writing Capstone 2.0 Projects