Run OpenClaw with Ollama
Connect OpenClaw to local or remote Ollama models. Choose the right endpoint, check tool support, and distinguish local inference from Ollama Cloud.
OpenClaw can use models served by Ollama on the same computer, another reachable computer, or Ollama Cloud. For local inference, run a tool-capable model in Ollama and connect OpenClaw using its native Ollama provider. The base URL normally ends at port 11434, without /v1. Verify an actual tool-using task, not just a text reply.
Decide where the model will run
OpenClaw runs the agent; Ollama serves the model that decides what the agent should do. They can live on the same machine, but they do not have to. A small server running OpenClaw can call Ollama on a more capable machine, provided the connection is reachable and access is controlled.
The OpenClaw Ollama provider supports local and cloud-backed use. Those have different consequences:
- Local inference: your own machine loads and runs the model. Its memory, speed and uptime determine the experience.
- A separate Ollama machine: the agent sends requests to that machine. It must stay online, even when you are away from the device you use to chat.
- Ollama Cloud: inference runs with the provider. Using the Ollama name does not make the model local.
If your reason for choosing Ollama is keeping model requests on hardware you control, choose a local model route deliberately. That still says nothing about external tools: an agent can use a local model and send a document to an online service as part of its work.
Connect through Ollama setup
Install Ollama on the machine that will serve the model, start it, and install a model suitable for your hardware and agent tasks. Text completion alone is not enough: the model needs to handle tool calls and enough context for OpenClaw’s instructions, conversation and tool results.
On a fresh OpenClaw setup, run:
openclaw onboardChoose Ollama, then the appropriate mode. The setup documentation describes Cloud + Local, Cloud only and Local only. Local modes ask for the Ollama base URL and inspect available models; Cloud only asks for a real Ollama credential. Direct hosted use has a dedicated ollama-cloud provider.
For an existing installation, keep the current working provider available while adding Ollama. Make the first model switch in a separate test conversation, then use the model-switching guide when you are ready to make it your everyday choice.
Use the address OpenClaw can actually reach
If Ollama and the Gateway share the same network environment, a typical native base URL is:
http://127.0.0.1:11434If they are on different machines, use the Ollama machine’s reachable address instead. A localhost address always refers to the environment making the request. Inside a container, it is not automatically your laptop or the container host.
Keep the provider API set to ollama. Do not append /v1 to follow an unrelated OpenAI-compatible setup tutorial: OpenClaw’s native integration uses Ollama’s own chat API. The troubleshooting reference identifies the wrong API mode as a cause of tools being printed as JSON text instead of executed.
For local or private-network endpoints, OpenClaw can use ollama-local as a credential marker. That is not a password protecting your server. Do not expose an unauthenticated endpoint publicly to make a connection work; arrange private reachability or proper authenticated access. Public remote endpoints and Ollama Cloud require real credentials.
Check the model, then check a real agent task
On the Ollama host, check what is installed. On the OpenClaw host, check what the agent can select:
ollama list
openclaw models list --provider ollamaThese can be different inventories if the programs point at different machines. OpenClaw’s model-discovery reference also notes that a nonempty manual model list replaces discovery. A model downloaded somewhere else is not automatically available through this endpoint.
Fresh guided setup has a further distinction: automatic candidates are models already loaded in memory, with tool support and sufficient context confirmed. An eligible model installed but idle may need the explicit Local only setup path. Do not repeatedly download the same weights because the automatic picker did not offer them.
First establish that a reply works. Then give the agent a small read-only task with an observable result, such as inspecting a harmless file in its workspace. Confirm that it actually used a tool and returned the file’s contents. If ordinary text works but this fails, investigate the model’s tool support and agent workload rather than assuming the network is broken.
When it is slow or cannot connect
Test reachability from the machine and runtime that run the Gateway. For a same-host setup:
curl http://127.0.0.1:11434/api/tagsFor a remote endpoint, substitute its actual address. A refusal points toward the daemon, listener or network path. A valid response with the wrong models points toward the wrong Ollama instance. Neither is fixed by changing the prompt.
A large model may take time to load before its first reply. Long context also costs memory beyond the model weights themselves. Choose a model and context size the machine can sustain through the whole task, not merely one that finishes loading. Disabling tools might permit chat, but it does not produce a working tool-using agent.
Judge the result on the work you intend to delegate: whether it calls the right tools, follows constraints, completes reliably and responds quickly enough. Local inference removes per-request model billing from that route; it does not remove the hardware cost or make every local model a good fit for an agent’s workload.