Installation Guide

OpenClaw
+ llama.cpp

Install OpenClaw from scratch on Ubuntu and connect it to a local llama.cpp server. No API costs. No cloud. Full inference on your own GPU.
Model Qwen3.5-35B-A3B Q8_0
GPU NVIDIA RTX A6000
Port 8080 (llama.cpp)
Node v22+
Cost $0 / token
Prerequisites
llama.cpp server already running
Your llama.cpp server must be running and accessible before starting. Verify it is up:
bash · verify llama.cpp
curl http://localhost:8080/v1/models
# Should return model list JSON
Endpoint
localhost:8080
Model ID
Qwen3.5-35B-A3B
Context
32768 tokens
Speed
~77 tok/sec
Installation Steps
1
Install Node.js 22
OpenClaw requires Node.js v22 or higher. Install via NodeSource.
bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version   # should print v22.x.x
2
Install OpenClaw
Install the latest OpenClaw globally via npm.
bash
npm install -g openclaw@latest
openclaw --version
3
Run Onboarding Wizard
Run the wizard to initialize the workspace and install the gateway daemon. Skip provider selection — we configure llama.cpp manually in the next step.
bash
openclaw onboard --install-daemon
Complete the wizard with any provider selection. The config file will be overwritten in the next step with the correct llama.cpp settings.
4
Configure for llama.cpp
Replace the contents of ~/.openclaw/openclaw.json with the following config.
json · ~/.openclaw/openclaw.json
{
  "models": {
    "providers": {
      "llamacpp": {
        "baseUrl": "http://127.0.0.1:8080/v1",
        "apiKey": "dummy",
        "api": "openai-completions",
        "models": [
          {
            "id": "Qwen3.5-35B-A3B",
            "name": "Qwen3.5-35B-A3B",
            "reasoning": true,
            "input": ["text"],
            "cost": {
              "input": 0, "output": 0,
              "cacheRead": 0, "cacheWrite": 0
            },
            "contextWindow": 32768,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "llamacpp/Qwen3.5-35B-A3B"
      },
      "workspace": "/home/Ubuntu/.openclaw/workspace"
    }
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
    "auth": {
      "mode": "token"
    }
  }
}
openai-completions ✓ USE THIS
Standard OpenAI format. Correct for llama.cpp, vLLM, LiteLLM, and Ollama. Returns standard chat/completions response.
openai-responses NOT FOR LLAMA.CPP
Only for specialized APIs like MiniMax that return non-standard response formats. Do not use with llama.cpp.
5
Start the Gateway
Start OpenClaw gateway in verbose mode to confirm llama.cpp connection.
bash
openclaw gateway --port 18789 --verbose
6
Test the Agent
Send a message directly to the agent and confirm it is routing through llama.cpp.
bash
openclaw agent --message "What is the derivative of x squared times sin 3x?"

# Check gateway status
openclaw status

# Run full diagnostics
openclaw doctor
If the response arrives and matches the quality you saw from the Python test, llama.cpp routing is working correctly. You can now add any channel (Telegram, Discord, Slack) on top of this config.
7
Add Channels (Optional)
To add Telegram or any other channel, extend the config with the channels section. The llama.cpp provider config stays exactly the same.
json · add to openclaw.json
"channels": {
  "telegram": {
    "botToken": "YOUR_BOT_TOKEN_HERE",
    "dmPolicy": "pairing"
  }
}
After adding a channel, restart the gateway: openclaw gateway restart