curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install nodesudo apt update && sudo apt install -y libatomic1curl -fsSL https://ollama.ai/install.sh | sh
systemctl start ollama
ollama pull qwen2.5-coder:7bThis is a optimum model for 8GB RAM and CPU-only setups (e.g., a VPS without a GPU). If you have a stronger GPU, replace
qwen2.5-coder:7bwith a larger model likeqwen2.5-coder:32bordeepseek-r1:32b.
npm install -g openclaw@latestopenclaw onboard --install-daemon- Select "Yes, I understand this is inherently risky" β Enter
- Select Quick Start β Enter
- Providers: select Skip for now β Enter
- Select All Providers β Enter
- Select Enter model manually β Enter (If you see anthropic/claude-opus-4-6, just press enter)
- Select Telegram β Enter
- Go to Telegram, find @BotFather, send
/newbot, create your bot, and copy the access token - Paste your bot token β Enter
- Select Yes, configure skills β Enter
- Install Homebrew β select npm
- Select your skills using arrow keys + spacebar (recommended: Claw Hub for adding custom skills later)
- Press Enter to confirm skill selection
- Add any API keys required for your selected skills (You can skip this step by select No and press enter)
- Install the gateway service when prompted
- Select Do this later for hatching
- You should see "Onboarding complete"
Paste this command to replace the default model config with your local Ollama model:
python3 -c "
import json
path = '/home/ubuntu/.openclaw/openclaw.json'
with open(path) as f:
cfg = json.load(f)
cfg['agents']['defaults']['model']['primary'] = 'ollama/qwen2.5-coder:7b'
cfg['agents']['defaults']['models'] = {'ollama/qwen2.5-coder:7b': {'alias': 'Qwen 2.5-Coder 7B'}}
cfg['models'] = {'mode': 'merge', 'providers': {'ollama': {'baseUrl': 'http://127.0.0.1:11434/v1', 'apiKey': 'ollama-local', 'api': 'openai-responses', 'models': [{'id': 'qwen2.5-coder:7b', 'name': 'Qwen 2.5-Coder 7B', 'reasoning': False, 'input': ['text'], 'cost': {'input': 0, 'output': 0, 'cacheRead': 0, 'cacheWrite': 0}, 'contextWindow': 32000, 'maxTokens': 4096}]}}}
with open(path, 'w') as f:
json.dump(cfg, f, indent=2)
print('Done')
"You should see "Done" if it worked.
If you get an error such as `FileNotFoundError: [Errno 2]` you can find your path with `ls -a ~/.openclaw/openclaw.json` this code and replace it with the path in the command.Swap
qwen2.5-coder:7bwith whatever model you pulled in Step 3.
systemctl --user restart openclaw-gateway- Open your Telegram bot chat and send any message
- The bot will reply with a pairing code and a command
- Copy the command, replace the code, and paste it in your terminal:
openclaw pairing approve telegram YOUR_PAIRING_CODEIf you want to use OpenClaw Web UI, you can go
http://127.0.0.1:18789this address.
That's it β your OpenClaw bot is now running with your local Ollama model through Telegram!