Skip to content

aquin0x/OpenClaw-Ollama-Ubuntu-Setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 

Repository files navigation

OpenClaw + Ollama: Full Setup Guide for Ubuntu VPS

Step 1: Install Node.js

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install node

Step 2: Install libatomic1 Library

sudo apt update && sudo apt install -y libatomic1

Step 3: Install Ollama and Pull a Model

curl -fsSL https://ollama.ai/install.sh | sh
systemctl start ollama
ollama pull qwen2.5-coder:7b

This 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:7b with a larger model like qwen2.5-coder:32b or deepseek-r1:32b.


Step 4: Install OpenClaw

npm install -g openclaw@latest

Step 5: Run the OpenClaw Wizard

openclaw onboard --install-daemon

Step 6: Follow the wizard steps:

  1. Select "Yes, I understand this is inherently risky" β†’ Enter
  2. Select Quick Start β†’ Enter
  3. Providers: select Skip for now β†’ Enter
  4. Select All Providers β†’ Enter
  5. Select Enter model manually β†’ Enter (If you see anthropic/claude-opus-4-6, just press enter)
  6. Select Telegram β†’ Enter
  7. Go to Telegram, find @BotFather, send /newbot, create your bot, and copy the access token
  8. Paste your bot token β†’ Enter
  9. Select Yes, configure skills β†’ Enter
  10. Install Homebrew β†’ select npm
  11. Select your skills using arrow keys + spacebar (recommended: Claw Hub for adding custom skills later)
  12. Press Enter to confirm skill selection
  13. Add any API keys required for your selected skills (You can skip this step by select No and press enter)
  14. Install the gateway service when prompted
  15. Select Do this later for hatching
  16. You should see "Onboarding complete"

Step 6: Connect Ollama to OpenClaw

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:7b with whatever model you pulled in Step 3.


Step 7: Restart the Gateway

systemctl --user restart openclaw-gateway

Step 8: Pair Telegram

  1. Open your Telegram bot chat and send any message
  2. The bot will reply with a pairing code and a command
  3. Copy the command, replace the code, and paste it in your terminal:
openclaw pairing approve telegram YOUR_PAIRING_CODE

If you want to use OpenClaw Web UI, you can go http://127.0.0.1:18789 this address.


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

About

πŸ€– Full step-by-step guide to setting up OpenClaw with self-hosted Ollama on an Ubuntu VPS. Learn how to deploy your private, local AI agent via Telegram.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors