How to Set Up OpenClaw with Ollama for Local AI Agents
OpenClaw's Ollama integration lets you run a fully autonomous AI agent powered by local models, with a single command handling installation, security setup, model selection, and gateway launch. This guide walks through the end-to-end setup, helps you pick the right model for your hardware, and shows how to persist agent outputs in shared workspaces.
What OpenClaw and Ollama Do Together
OpenClaw is an autonomous AI agent framework that bridges messaging platforms, coding tools, and file operations through a centralized gateway. Ollama is a local model runtime that pulls and serves open-weight LLMs on your own hardware. Together, they give you an AI agent that runs entirely on your machine, with no data leaving your network and no per-token API charges.
The integration works through Ollama's launch system. Rather than installing OpenClaw separately, configuring model endpoints, and wiring up the gateway manually, a single launch command handles the entire onboarding flow. Ollama detects whether OpenClaw is installed, pulls it via npm if not, walks you through model selection, configures the gateway daemon, and drops you into the OpenClaw terminal interface.
This matters because the typical setup for a local AI agent involves five or six separate tools and configuration files. You need a model server, an agent framework, API endpoint configuration, security settings, and usually some glue code to connect everything. The Ollama launch command collapses that into one step.
The result is a local agent that can execute shell commands, manage files, search the web, send messages through WhatsApp or Telegram or Slack, and perform multi-step coding tasks. All powered by models running on your GPU, with no external API dependencies required.
Related guides
- How to Use Cline with Ollama for Local AI CodingCline reports 4,672,635 Visual Studio Marketplace installs, yet many teams still send proprietary code to cloud APIs...
- How to Set Up Hermes Agent From ScratchHermes Agent is an open-source autonomous AI agent from Nous Research that supports 200+ LLM models, 20+ messaging...
- How to Set Up ClawHub for OpenClawClawHub is the public skill registry for OpenClaw, with over 13,000 community skills available. This guide walks...
- How to Set Up OpenClaw MCP ServerConnect OpenClaw to Fastio's hosted MCP server for consolidated tools covering files, sharing, and AI. Connect directly...
- How to Set Up an RAG Knowledge Base in OpenClawConnect your agents to your proprietary data with automated indexing and semantic retrieval. Enable Intelligence Mode...
- How to Set Up Shared Workspaces in OpenClawOpenClaw workspace setup provides agents with persistent, shared storage for collaborative projects. Connect to the...
More on this subject: OpenClaw Setup and Guides (199 guides)
Prerequisites and System Requirements
Before running the launch command, you need two things installed:
- A recent version of Ollama with launch support. The launch subsystem was added in a mid-2025 release. If your copy predates it, update from ollama.com.
- Node.js (LTS). OpenClaw installs via npm, so you need a working Node.js runtime. Any recent LTS version works.
Operating system support:
- macOS (Apple Silicon or Intel)
- Linux (x86_64 or ARM64)
- Windows via WSL2
Hardware for local models:
Local model inference is GPU-bound. The two recommended local models have different VRAM requirements:
- gemma4 needs approximately 16 GB of VRAM. This fits on an RTX 4090, an M1 Pro with 32GB unified memory, or similar.
- qwen3.5 needs approximately 11 GB of VRAM. This fits on an RTX 3080, an M1 with 16GB unified memory, or similar.
If your hardware can't accommodate either local model, you can use one of the cloud model options instead. Cloud models route through Ollama's gateway and require an Ollama account, but they still run through the same OpenClaw interface.
Context window: A minimum of 64k tokens is strongly recommended for local models. Agents need long context to track multi-step tasks, maintain conversation history, and process large code files. Models with shorter context windows will work for simple tasks but degrade on complex workflows.
The Five-Step Launch Flow
According to the official Ollama documentation, you start the setup by running the Ollama launch command for OpenClaw in your terminal. Ollama executes five steps automatically:
1. Installation check. If OpenClaw isn't already installed, Ollama detects this and installs it via npm. You'll see a confirmation prompt before any packages are added to your system.
2. Security briefing. OpenClaw can execute shell commands, modify files, and access network resources. The setup displays warnings about tool access risks and asks you to acknowledge them before proceeding. This is the point where you should think about isolation: running agents in a dedicated user account or container limits the blast radius if something goes wrong.
3. Model selection. You choose between local models (running on your GPU) and cloud models (running through Ollama's gateway). The menu shows each model's strengths and resource requirements.
4. Gateway configuration. OpenClaw's gateway daemon handles routing between the agent, your chosen model, and any connected services. The setup configures this automatically based on your model selection.
5. Interface launch. The OpenClaw terminal UI opens, connected to your chosen model and ready for interaction.
For non-interactive environments (CI, scripting, headless servers), the launch command accepts flags to skip interactive prompts and specify a model directly. You can also re-enter the model selection flow later without reinstalling or reconfiguring channels. The Ollama OpenClaw integration docs cover the full flag reference for headless and reconfiguration use cases.
Persist your local agent outputs in a searchable workspace
Fastio provides persistent cloud storage and MCP-ready endpoints for your OpenClaw agent's file reads and writes. Start with a 14-day Business Trial.
Choosing the Right Model
Model selection depends on your hardware, your use case, and whether you need fully offline operation.
Cloud models route inference through Ollama's servers. They offer larger context windows, better reasoning on complex tasks, and no local GPU requirements. The tradeoff is latency, internet dependency, and the fact that your prompts leave your machine.
Recommended cloud options:
- kimi-k2.5:cloud handles multimodal reasoning with subagent support. Best for complex, multi-step tasks that involve both text and image understanding.
- qwen3.5:cloud excels at reasoning, coding, and agentic tool use with vision capabilities. A strong general-purpose choice.
- glm-5.1:cloud focuses on reasoning and code generation. Good for purely text-based coding workflows.
Local models run entirely on your hardware. No internet needed after the initial model pull, no data leaves your machine, and no per-token costs. The tradeoff is VRAM requirements and potentially slower inference on consumer hardware.
Recommended local options:
- gemma4 (~16 GB VRAM) offers strong general capabilities with good instruction following. Works well for file management, coding tasks, and multi-step reasoning.
- qwen3.5 (~11 GB VRAM) provides solid coding and tool-use performance at a lower memory footprint. A good default for machines with 16-24 GB of VRAM.
Decision framework:
If you need complete privacy or offline operation, choose a local model. If you need maximum reasoning quality and have reliable internet, choose a cloud model. If you're unsure, start with qwen3.5 locally. It has the lowest hardware requirement of the recommended options and handles most common agent tasks well.
You can switch models at any time through the launch command's configuration mode without losing your agent's channel configuration or gateway settings.
Configuring Messaging and Web Search
Once OpenClaw is running, you can connect it to messaging platforms and enable web search.
Messaging channels:
The channel configuration menu covers WhatsApp, Telegram, Slack, Discord, and iMessage. Each channel requires its own authentication flow (API tokens for bots, QR code scanning for WhatsApp, OAuth for Slack). Once connected, you can interact with your local agent from any of these platforms, not just the terminal interface.
The messaging bridge is bidirectional: you send commands to the agent through chat, and the agent can send results back. This is useful for long-running tasks where you don't want to keep a terminal open.
Web search:
Web search gives your agent access to current information beyond its training data. For cloud models, web search activates automatically during the launch flow. For local models, you need to authenticate with your Ollama account first because search queries route through Ollama's infrastructure even when inference is local.
Gateway management:
The gateway daemon runs in the background after launch. You can stop it through the gateway subcommand when needed. The gateway automatically reloads if you relaunch OpenClaw, so you don't need to manage it manually during normal use.
Running fully offline:
For air-gapped environments, use a local model and skip the web search configuration. Your agent can still execute shell commands, manage files, and perform coding tasks. It just won't have access to current web information. Pull your chosen model before disconnecting from the internet, since Ollama needs to download the model weights once before they're available for offline inference.
Persisting Agent Outputs in Shared Workspaces
A local OpenClaw agent produces files: code it writes, reports it generates, configurations it creates. By default, these live on your local filesystem. That works for solo use, but falls apart when you need to hand results to a teammate, archive outputs for audit, or let another agent pick up where this one left off.
Local persistence options:
- Keep everything in a dedicated directory that the agent writes to. Simple, no setup, but siloed to one machine.
- Push to a git repository. Works for code, but awkward for binary files, large datasets, or files that change frequently.
- Upload to cloud storage (S3, Google Drive, Dropbox). Requires additional tooling and doesn't give you searchability.
Workspace persistence with Fastio:
Fastio workspaces give agents a shared location where outputs are indexed for search. Upload a file and it is indexed and searchable once Intelligence is enabled for the workspace, which means another agent (or a human) can ask questions about the content without downloading and reading every file manually.
The practical workflow: your OpenClaw agent generates a report, uploads it to a Fastio workspace via the remote MCP server (https://mcp.fast.io/mcp), and a colleague can find it, read it, or ask questions about it from the web UI. No manual file transfer, no "which Slack thread was that in?" confusion.
For teams running multiple agents, Fastio's file version history with restore and append-only audit trail prevent conflicting updates when multiple agents collaborate. The audit trail shows exactly which agent created or modified each file, which matters when you're debugging unexpected outputs.
Fastio offers a 14-day Business Trial (credit card required), with plans scaling from Starter to Business and Growth. That provides a local OpenClaw setup with persistent, searchable, shareable outputs.
Fastio exposes Streamable HTTP at https://mcp.fast.io/mcp and legacy SSE at https://mcp.fast.io/sse, so any agent that supports Model Context Protocol can read and write workspaces directly. OpenClaw connects via remote MCP as a seamless output destination for generated files.
Frequently Asked Questions
How do I set up OpenClaw with Ollama?
Run `ollama launch openclaw` in your terminal. This single command checks for an existing OpenClaw installation (installs it via npm if missing), walks you through model selection, configures the gateway daemon, and launches the terminal interface. You need a recent version of Ollama with launch support and Node.js installed beforehand.
What models work best with OpenClaw locally?
The recommended local models are gemma4 (approximately 16 GB VRAM) and qwen3.5 (approximately 11 GB VRAM). Both provide 64k+ token context windows, which is the minimum recommended for multi-step agent tasks. qwen3.5 is the better starting point if you have limited VRAM, while gemma4 offers stronger general reasoning.
Can OpenClaw run without internet using Ollama?
Yes. Pull your chosen model through Ollama while you still have internet access, then launch OpenClaw with that local model. All inference runs on your GPU with no external API calls. You won't have web search capability offline, but file management, shell commands, and coding tasks all work without connectivity.
How much VRAM does OpenClaw need with Ollama?
It depends on the model. The minimum recommended local model (qwen3.5) needs approximately 11 GB of VRAM. gemma4 needs approximately 16 GB. If you don't have a GPU with sufficient VRAM, cloud models like kimi-k2.5:cloud or qwen3.5:cloud route inference through Ollama's servers instead.
How do I change models after initial setup?
Relaunch OpenClaw through Ollama's configuration mode to re-enter the model selection flow without reinstalling or reconfiguring channels. The [Ollama OpenClaw integration docs](https://docs.ollama.com/integrations/openclaw) describe the exact flags for headless model switching and reconfiguration.
Is OpenClaw safe to run with full tool access?
OpenClaw can execute shell commands and modify files, so isolation matters. The setup includes a security briefing that explains the risks. For production use, run the agent in a container, a dedicated user account, or a virtual machine to limit the impact of unexpected commands. Start with read-only permissions and expand access as you build confidence in the agent's behavior.
Related Resources
Persist your local agent outputs in a searchable workspace
Fastio provides persistent cloud storage and MCP-ready endpoints for your OpenClaw agent's file reads and writes. Start with a 14-day Business Trial.