Install Ollama
- On the machine which will host the Ollama, create a folder for ollama.
mkdir ollama cd ollama
-
Create
docker-compose.yamlinollamafolder with content:services: ollama: image: ollama/ollama:latest container_name: ollama ports: - "11434:11434" volumes: - ./data:/root/.ollama restart: unless-stopped -
Pull a model for local use, for example,
qwen3:0.6b:docker compose exec ollama ollama pull qwen3:0.6b
Install OpenClaw
-
On Raspberry Pi, get OpenClaw source code from: https://github.com/openclaw/openclaw
-
Create docker:
cd openclaw export OPENCLAW_SANDBOX=1 export OPENCLAW_IMAGE=ghcr.io/openclaw/openclaw:latest ./docker-setup.sh -
Open config file
~/.openclaw/openclaw.json, in sectiongateway, addcontrolUifield:{ "gateway": { "controlUi": { "allowedOrigins": [ "http://localhost:18789", "http://127.0.0.1:18789", "http://<your_pi_address>:18789" ] } } } -
Restart gateway:
docker compose restart openclaw-gateway
Add local Ollama to OpenClaw
Open ~/.openclaw/openclaw.json
-
In section
models>providers, add information for the local Ollama:{ "models": { "mode": "merge", "providers": { "ollama": { "baseUrl": "http://<ollama_machine_address>:11434", "api": "ollama", "models": [ { "id": "qwen3:0.6b", "name": "qwen3:0.6b", "reasoning": false, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 16000, "maxTokens": 512, "compat": { "thinkingFormat": "qwen" } } ] } } } } -
Restart gateway:
docker compose restart openclaw-gateway -
Now your agent can use
ollama/qwen3:0.6bas its model.
Comments