How to Set Up OpenClaw with Ollama (Local AI Agent, No API Needed)
Tutorials

How to Set Up OpenClaw with Ollama (Local AI Agent, No API Needed)

Setting up OpenClaw with Ollama was harder than I expected. The documentation is scattered, steps change quickly, and small issues can easily break the setup.

If you're searching for how to set up OpenClaw with Ollama, you're likely trying to avoid API costs, run everything locally, or reduce dependence on external services.

I've been through the same frustration, so this guide keeps things simple.

The good news is that setup is now much easier thanks to recent Ollama improvements. In this guide, I'll walk you through the working steps, common pitfalls, and a simpler alternative if you want to skip the technical setup entirely.

What Is OpenClaw and Why Use Ollama?

OpenClaw is an AI agent framework that can handle real tasks — clearing your inbox, sending emails, managing your calendar, and more. You connect it to messaging apps like Telegram, WhatsApp, or Discord, and it works as a personal AI assistant accessible from anywhere.

The thing that makes OpenClaw powerful is that it can actually take actions on your behalf. It can read files, execute commands, search the web, and complete multi-step tasks. This isn't just a chatbot — it's an agent.

Here's where Ollama comes in.

Ollama lets you run large language models locally on your own hardware. Instead of sending your data to OpenAI or Anthropic every time you want to use an AI agent, Ollama runs the model right on your machine. You don't need API keys, you don't pay per token, and your data never leaves your computer.

The combination of OpenClaw + Ollama gives you a fully local AI agent. No subscriptions, no API costs, complete privacy.

The real question is: what do you actually get with this setup?

You get an AI agent that can work completely offline (for local models), handle complex multi-step tasks, connect to your messaging apps, and run on hardware you already own. The tradeoff is that local models typically aren't as capable as the latest cloud offerings, and setup requires some technical comfort.

Requirements Before Setting Up OpenClaw with Ollama

Before we dive in, let me make sure you have everything you need. Trust me, it's better to check this now than to get halfway through setup and realize something's missing.

Hardware Requirements

The models you run will determine what hardware you need. Here's a quick reference:

  • 8GB VRAM: Can run smaller models like qwen2.5:7b or llama3.2:3b
  • 16GB VRAM: Opens up llama3.3:70b or qwen2.5:14b
  • 24GB+ VRAM: You can run larger reasoning models like deepseek-r1:32b

If you don't have a GPU with enough VRAM, Ollama can still run models on CPU — it just works slower. For a usable experience, I'd recommend at least 8GB of VRAM.

Software Requirements

  • Ollama 0.17 or later — The simplified setup method I'm showing you requires this version. If you're on an older version, update first.
  • Node.js — OpenClaw is installed via npm. You need Node.js 18 or newer, though Node.js 22+ is recommended.
  • Mac, Linux, or Windows with WSL — OpenClaw doesn't run natively on Windows, but WSL (Windows Subsystem for Linux) works fine.

Model Context Requirements

OpenClaw agents work best with models that have at least 64k context length. This matters because agent tasks involve maintaining conversation history, tool definitions, and context simultaneously. Cloud models like kimi-k2.5:cloud or minimax-m2.5:cloud give you the full context length. Local models vary — check your model's specs.

How to Set Up OpenClaw with Ollama?

There are two ways to set up OpenClaw with Ollama. I'll start with the newer, simpler method that Ollama introduced in version 0.17, then show you the manual approach if you prefer more control.

Method 1: The New Way (Recommended)

If you're on Ollama 0.17 or later, the setup is dramatically simpler than it used to be. Here's what you do:

Step 1: Make sure Ollama is installed

Download Ollama from ollama.com/download if you haven't already. Once installed, you can verify it's running by opening a terminal and typing:

ollama serve

Keep Ollama running in the background.

Step 2: Run the launch command

This is where things got better. Instead of manually installing OpenClaw, configuring files, and wrestling with JSON settings, you can now do it with one command:

ollama launch openclaw --model kimi-k2.5:cloud

Ollama handles everything from here. If OpenClaw isn't installed, it prompts you to install it. It configures the gateway automatically. It opens the terminal interface.

Step 3: Choose your model

When you run the launch command, Ollama shows you a model selector. The recommended models for agents include:

  • kimi-k2.5:cloud — Multimodal reasoning with subagents (cloud, no local setup needed)
  • minimax-m2.5:cloud — Fast, efficient for productivity tasks (cloud)
  • glm-5:cloud — Strong reasoning and code generation (cloud)

If you want to run locally instead, you can pull models first:

ollama pull llama3.3 ollama pull qwen2.5-coder:32b ollama pull deepseek-r1:32b

Then use them with:

ollama launch openclaw --model llama3.3

Step 4: Start chatting

That's it. OpenClaw opens in your terminal and you can start chatting with your AI assistant right away.

Method 2: Manual Setup (More Control)

If you want to understand the underlying configuration or prefer to set things up manually, here's the traditional approach.

Step 1: Install Ollama and pull a model

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

Step 2: Install OpenClaw via npm

npm install -g openclaw

Step 3: Configure the connection

OpenClaw needs to know how to reach Ollama. The key is setting an API key (even though Ollama doesn't really need one, OpenClaw expects this field):

export OLLAMA_API_KEY="ollama-local"

Or use the config command:

openclaw config set models.providers.ollama.apiKey "ollama-local"

Step 4: Set your default model

openclaw models list openclaw models set ollama/llama3.3

Step 5: Start the gateway

openclaw gateway start

Step 6: Connect messaging apps (optional)

If you want to use OpenClaw through Telegram, WhatsApp, or other chat apps:

openclaw configure --section channels

Follow the prompts to connect your preferred platform.

Which Method Should You Use?

If you're just getting started and want the fastest path to a working setup, use Method 1. The ollama launch command handles all the complexity automatically.

If you need more control over your configuration, want to understand what's happening under the hood, or are setting up a more complex multi-agent system, go with Method 2.

Common Issues When Running OpenClaw with Ollama

Let me be real with you — setting up OpenClaw with Ollama isn't always smooth. Based on what I've seen in various community discussions and troubleshooting threads, here are the issues people run into most often and how to fix them.

Issue 1: "Ollama Not Detected" Error

If OpenClaw can't find Ollama, start by verifying Ollama is actually running:

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

If you get JSON back, Ollama is running. If you get a connection error, start Ollama with:

ollama serve

Then check that you've set the API key variable:

export OLLAMA_API_KEY="ollama-local"

The key thing here: don't define an explicit models.providers.ollama entry in your config unless you need custom settings. The auto-discovery works best when it's implicit.

Issue 2: Empty Responses or Broken Parsing

This is one of the most common issues. You connect to Ollama, the model responds, but OpenClaw shows nothing or garbled text.

The fix is usually about the API mode. OpenClaw defaults to the native Ollama API, but sometimes people accidentally switch to OpenAI-compatible mode (using /v1 in the URL), which causes parsing issues.

Native mode (correct):

baseUrl: "http://127.0.0.1:11434" api: "ollama"

OpenAI-compatible mode (often causes issues):

baseUrl: "http://127.0.0.1:11434/v1" api: "openai-completions"

If you're seeing empty responses, go back to native mode. Also note that tool calling doesn't work reliably in OpenAI-compatible mode.

Issue 3: Models Hanging or Timing Out

Local models sometimes hang indefinitely, especially with multi-step agent tasks. This is a known issue with how OpenClaw's hooks interact with Ollama's streaming.

The fix: OpenClaw hooks can cause Ollama to hang. If your models keep timing out, try disabling hooks in your config:

openclaw hooks disable

Then restart the gateway:

openclaw gateway restart

Also check that your model has a sufficient context window. Agents benefit from at least 64k tokens. Some smaller models may struggle with complex multi-step tasks.

Issue 4: Tool Calling Not Working

You ask the model to do something, but it just talks about what it wants to do instead of actually doing it.

This usually happens for one of three reasons:

  • 1. Tool permissions are locked down — Check your OpenClaw permissions config. Local models especially need tools to be explicitly allowed.
  • 2. Wrong API mode — Tool calling only works reliably in native Ollama mode, not OpenAI-compatible mode.
  • 3. Model capability — Not all models handle tool calling well. Larger models like llama3.3:70b or cloud models tend to work better than smaller local models.

Issue 5: Gateway Keeps Asking for Approval

Even with permissions configured to auto-approve, some users report the gateway still prompting for approval repeatedly.

This often happens due to session state. Try:

openclaw gateway restart

If that doesn't help, check your security policy settings in the config. A full gateway reset sometimes helps:

openclaw gateway --force

Issue 6: No Models Showing in OpenClaw

You ran ollama list and models are there, but openclaw models list shows nothing.

Two fixes:

First, ensure the OLLAMA_API_KEY is set:

export OLLAMA_API_KEY="ollama-local"

Second, if auto-discovery isn't working, define the model explicitly in your config:

openclaw config set models.providers.ollama.models[0].id "llama3.3" openclaw config set models.providers.ollama.models[0].contextWindow 131072

Then restart the gateway.

Easier No-Code Alternative (Recommended)

I want to be honest with you — even with these guides, setting up OpenClaw with Ollama can be frustrating. There are configuration files to manage, compatibility issues to debug, and concepts that assume you're comfortable with the command line.

If that sounds overwhelming or you just want to get running faster, there's an alternative worth considering.

Nut Studio is a no-code AI agent builder that runs locally on your machine. You can deploy a personal AI agent in about 3 minutes with a single click. No JSON configs, no terminal commands, no need to understand how Ollama API modes work.

🚀 Nut Studio makes OpenClaw easy to deploy

Nut Studio lets you run OpenClaw with one click, no setup or coding required. Log in to enjoy 30 free points!

Free Download

What makes Nut Studio different is its focus on accessibility. It handles all the technical complexity behind the scenes. You pick your model, configure what you want the agent to do, and go. Everything runs on your own hardware, so your data stays private and you don't pay API fees.

For non-technical users who want the benefits of a local AI agent without the setup headaches, Nut Studio fills that gap well.

Deployment Speed
5 Seconds
Average Deployment Time
Availability
99.9%
Service Availability Guarantee
Support Team
24/7
Round-the-Clock Technical Support

FAQs

Do I need a GPU to run OpenClaw with Ollama?

A GPU makes a significant difference, but it's not strictly required. Ollama can run on CPU only, though performance will be slower. For a usable experience, I'd recommend at least 8GB of VRAM. Without a GPU, expect slower responses, especially for larger models.

Is this completely free to run?

Yes. Ollama and OpenClaw are both open-source. Running local models costs nothing beyond your electricity and hardware. However, you do need capable hardware to run decent models, and cloud models via Ollama's cloud service have their own pricing.

What's the best model for OpenClaw agents?

Cloud models like kimi-k2.5:cloud or minimax-m2.5:cloud work best because they have full 128k context length. For local models, aim for at least 32B parameter models with 64k+ context windows. Deepseek-r1:32b and llama3.3:70b are popular choices.

Can I use this without any internet connection?

Yes, if you use local models only. Cloud models require internet. Local models (llama3.3, qwen2.5, deepseek-r1, etc.) run entirely offline once downloaded.

How do I connect OpenClaw to Telegram or WhatsApp?

Run openclaw configure --section channels and follow the prompts. You'll need to create developer accounts/bots for each platform (Telegram BotFather for Telegram, for example), but the actual configuration in OpenClaw is guided.

What's the difference between native Ollama mode and OpenAI-compatible mode?

Native mode uses Ollama's own API directly at http://host:11434. OpenAI-compatible mode adds /v1 and formats requests like OpenAI's API. Native mode is generally more reliable, especially for tool calling. Use OpenAI-compatible mode only if you specifically need compatibility with tools designed for OpenAI's format.

Conclusion

Setting up OpenClaw with Ollama is genuinely valuable if you want a powerful, private, zero-cost AI agent. The process has gotten significantly simpler with the newer ollama launch command, and the community resources have improved. That said, it's still a technical process that requires some comfort with configuration and debugging.

My recommendation:

If you're comfortable with command lines and configuring JSON files, follow the steps I outlined for the manual setup. You'll have more control and understand exactly how everything connects.

If you want the fastest path to a working local AI agent without the technical complexity, Nut Studio is worth checking out. It removes the friction while keeping the privacy and cost benefits.

Either way, you now have the actual steps that work and the real issues to watch out for. No fluff, no outdated information — just what you need to get running.

Contents