Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Pyr0zen/61e08b671bc2f7c9ce9b4e55980bc40d to your computer and use it in GitHub Desktop.

Select an option

Save Pyr0zen/61e08b671bc2f7c9ce9b4e55980bc40d to your computer and use it in GitHub Desktop.

Qwen 3.5 (0.8B) + OpenClaw + Ollama: Full Setup Guide


Before You Start

If you're thinking of running OpenClaw on your main PC, I'd strongly suggest using a VPS instead. Anything you can do on your PC, OpenClaw will be able to do on your PC, which is extremely risky if you have personal info on it.

A VPS is essentially just a fresh virtual PC. That way you're not risking any of your personal data and the VPS runs 24/7 so you'll have access to the bot whenever you want. It's also much cheaper than spending hundreds of dollars on a dedicated device like a Mac Mini.

The VPS provider that I use is Hostinger because it's the simplest one to set up and also one of the cheapest. If you use the link below you will get an extra 20% off.

πŸ‘‰ https://www.hostinger.com/self-hosted-n8n?REFERRALCODE=HOWTO20

Coupon code: HOWTO20


Step 1: Update Your System

sudo apt update && sudo apt upgrade -y

Step 2: Install Node.js

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs

Verify:

node --version

Step 3: Install Ollama

curl -fsSL https://ollama.ai/install.sh | sh

Verify:

ollama --version

Step 4: Pull a Model

ollama pull qwen3.5:0.8b

Verify:

ollama list

This is a ~1GB model that runs on CPU. If you want a smarter model and have the RAM, replace qwen3.5:0.8b with qwen3.5:4b or qwen3.5:9b.


Step 5: Install OpenClaw

curl -fsSL https://openclaw.ai/install.sh | bash

Step 6: Run the Onboarding

openclaw onboard --install-daemon

This sets up the gateway and installs the background service. Press Ctrl+C when it's done.


Step 7: Set Up Telegram

openclaw configure --section channels
  1. Gateway location: select Local (this machine)
  2. Channels: select Configure/link
  3. Select Telegram (Bot API)
  4. Go to Telegram, find @BotFather, send /newbot, create your bot, copy the token
  5. Select Enter Telegram bot token, paste it, press Enter
  6. Select Finished
  7. DM access policies: select No

Step 8: Connect Ollama to OpenClaw

Paste this command to replace the default config with your local Ollama model:

If you pulled a different model in Step 4, swap qwen3.5:0.8b and Qwen3.5 0.8B with your model name.

python3 -c "
import json
with open('/root/.openclaw/openclaw.json') as f:
    cfg = json.load(f)
cfg['models'] = {'mode': 'merge', 'providers': {'ollama': {'baseUrl': 'http://127.0.0.1:11434/v1', 'apiKey': 'ollama', 'api': 'ollama', 'models': [{'id': 'qwen3.5:0.8b', 'name': 'Qwen3.5 0.8B', 'reasoning': False, 'input': ['text'], 'cost': {'input': 0, 'output': 0, 'cacheRead': 0, 'cacheWrite': 0}, 'contextWindow': 32768, 'maxTokens': 8192}]}}}
cfg['agents'] = {'defaults': {'model': {'primary': 'ollama/qwen3.5:0.8b'}}}
with open('/root/.openclaw/openclaw.json', 'w') as f:
    json.dump(cfg, f, indent=2)
print('Done')
"

You should see "Done" if it worked.

Important: This step must come AFTER Telegram setup because openclaw configure overwrites the config file.


Step 9: Restart Gateway + Pair Telegram

openclaw gateway stop
openclaw gateway start

Open your bot in Telegram and send it any message. It will reply with a pairing code. Approve it:

Replace CODE with the actual pairing code you received:

openclaw pairing approve CODE

Remove any arrows or brackets from the code. Just the plain code.


That's it β€” your OpenClaw bot is now running with a free local Ollama model through Telegram.


Need a VPS?

If you don't have one yet, I use Hostinger for all my setups. Takes under a minute to get a clean Ubuntu server running. Use the link below for an extra 20% off.

πŸ‘‰ https://www.hostinger.com/self-hosted-n8n?REFERRALCODE=HOWTO20

Coupon code: HOWTO20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment