Turning Your Local Model Into an Always-On Bot with OpenClaw
Connect OpenClaw, a self-hosted AI agent framework, to your local Ollama models so you get a persistent assistant in Discord or Telegram, not just a browser tab.
What OpenClaw actually is
Everything else in this pillar gets you a model you can talk to in a browser tab. That's genuinely useful, but it only works while you're sitting at that machine with that tab open. OpenClaw is a different piece of the stack: a self-hosted agent framework that runs as a background service and gives your model a persistent presence in Discord or Telegram - plus memory files it reads on every turn, so it can actually remember things about you and your setup across conversations.
Pointed at a cloud provider, it works like any hosted AI bot. Pointed at your local Ollama install, it's the same private, no-monthly-bill setup this whole site is about, just reachable from your phone instead of tied to one machine.
Installing OpenClaw
The official installer script handles Node.js and launches the onboarding wizard in one step:
curl -fsSL https://openclaw.ai/install.sh | bash
It detects your OS, installs Node.js if it's missing, installs OpenClaw, and starts onboarding automatically. During the wizard, when you reach the model/auth provider prompt, that's where you'll point it at Ollama instead of a cloud provider - covered next.
Connecting it to Ollama
Before touching OpenClaw's config, confirm Ollama itself is actually running and reachable:
curl http://localhost:11434/api/tags
# Should return JSON listing your pulled models
# "connection refused" means Ollama isn't running - start it with: ollama serve
The simplest way to wire the two together is a single environment variable - OpenClaw then auto-discovers every model you have installed:
export OLLAMA_API_KEY="ollama-local"
echo 'export OLLAMA_API_KEY="ollama-local"' >> ~/.bashrc
source ~/.bashrc
Restart OpenClaw after setting this, and it will query Ollama directly for your model list, read their context windows, and set every cost to $0 automatically.
~/.openclaw/openclaw.json naming exact models and a custom host. The auto-discovery route above covers most people's needs to start.
What actually goes wrong
Tool calls come out as plain text instead of actually running
This is almost always a URL mistake: if you're hand-writing a config block, the Ollama base URL must not have /v1 on the end. Adding it switches to Ollama's OpenAI-compatible endpoint, which breaks tool calling entirely - your bot will print raw tool JSON as a chat message instead of executing it. Use the plain native URL, http://127.0.0.1:11434, with "api": "ollama" set explicitly.
OpenClaw doesn't see any models
Confirm Ollama is actually reachable first with the same curl http://localhost:11434/api/tags check from above, then confirm OpenClaw's side:
openclaw models list
openclaw models status
Responses feel slow with more than one person messaging it
This is expected, not a misconfiguration - Ollama processes one request at a time, so on CPU-only hardware, a second person's message waits behind the first. Fine for a personal bot or a small group; a smaller model as the primary (with a larger one as fallback for when quality matters more) keeps things feeling responsive.
Common questions
Is OpenClaw the same thing as Ollama?
Does OpenClaw require a cloud account to work with Ollama?
Go deeper
This guide covers connecting OpenClaw to a local model. Discord and Telegram setup, memory files, custom skills, and hardening are their own topics with a full tutorial hub already built around them.
Written from hands-on security operations experience. More about this site →