Back to Blog
Guide2026-02-02

OpenClaw + Ollama: Run Your AI Agent Completely Offline

Want to run OpenClaw without any cloud dependencies or API costs? This guide shows you how to set up OpenClaw with Ollama for a fully offline, privacy-first AI agent experience.

Why Go Local with Ollama?

While OpenClaw works best with Claude Opus 4.5, not everyone wants to send data to the cloud. With Ollama, you can run powerful open-source models like Llama 3, Mistral, and Qwen locally on your machine. Benefits include:

  • Zero API costs—completely free to run
  • Complete data privacy—nothing leaves your machine
  • No internet required after initial setup
  • Full control over model selection and parameters
  • Great for sensitive enterprise or personal data

1Prerequisites

You'll need a machine with decent specs for local model inference. Here's what's recommended:

# Minimum requirements:
# - 16GB RAM (32GB+ recommended)
# - Modern CPU or GPU with CUDA/Metal support
# - 20GB+ free disk space for models

# Check your system:
node --version    # Requires v22+
ollama --version  # Install from ollama.com if missing

2Install Ollama

Ollama makes it trivial to run local LLMs. Install it with a single command, then pull your preferred model.

# Install Ollama (macOS/Linux)
curl -fsSL https://ollama.com/install.sh | sh

# Pull a recommended model
ollama pull llama3.1:8b      # Good balance of speed & quality
# Or for more capable responses:
ollama pull qwen2.5:14b      # Larger, slower, better reasoning

# Verify Ollama is running
ollama list
Tip: For the best experience, we recommend qwen2.5:14b or llama3.1:8b. Smaller models (7B) work but may struggle with complex multi-step tasks.

3Configure OpenClaw for Ollama

Point OpenClaw at your local Ollama instance. The configuration is straightforward—just change the model provider and endpoint.

# In ~/.openclaw/openclaw.json:
{
  "agent": {
    "model": "ollama/llama3.1:8b",
    "baseUrl": "http://localhost:11434"
  }
}

# Or configure via CLI:
openclaw config set agent.model ollama/llama3.1:8b
openclaw config set agent.baseUrl http://localhost:11434
Tip: You can switch between Ollama and cloud models anytime by updating the config. OpenClaw supports hot-swapping models without restart.

4Start and Verify

Launch OpenClaw and verify it's using your local Ollama model. The Gateway dashboard shows the active model connection.

# Start OpenClaw
openclaw start

# Check status (should show Ollama connection)
openclaw status

# Visit dashboard
# http://127.0.0.1:18789/

# Send a test message via your configured channel
# or use the WebChat interface

Performance Tips

Local models are inherently slower than cloud APIs. Here are tips to optimize your experience:

  • Use GPU acceleration (CUDA for NVIDIA, Metal for Apple Silicon) for 5-10x faster inference
  • Close other memory-intensive apps while running large models
  • Use smaller models (8B) for quick tasks, larger models (14B+) for complex reasoning
  • Enable model caching to avoid reloading between sessions
  • Consider using quantized models (Q4_K_M) for better speed/memory tradeoff

Limitations of Local Models

While powerful, local models have some limitations compared to cloud-hosted Claude:

  • Complex multi-step tasks may require more guidance
  • Browser automation accuracy may be reduced
  • Trading features are not recommended with local models
  • Slower response times, especially on CPU-only systems
  • No vision capabilities with most local models

What's Next?

Your offline AI agent is ready. Explore what you can build with it.