Server Deployment Guide
This guide is currently available in Chinese only. Read in Chinese →
A complete walkthrough for deploying OpenClaw on a fresh Ubuntu server with Telegram and AIGoCode model integration — 6 steps from zero to a working bot.
Recommended model relay: AIGoCode Pay-as-you-go, supports Claude Opus 4.6 and all major models. New users get a free credit bonus to cover initial exploration.
Prerequisites
- A fresh Ubuntu 22.04+ server
- Git installed:
sudo apt update && sudo apt install -y git - Node.js v22+:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash - && sudo apt-get install -y nodejs - An aigocode.com account with an API Key (sk-xxx format)
- A Telegram account
Step 1: Install OpenClaw
sudo npm install -g openclaw
Step 2: Create a Telegram Bot
Search for @BotFather on Telegram, send /newbot, follow the prompts to get your Bot Token.
Step 3: Run the Setup Wizard
openclaw onboard
Key choices:
- Model/auth provider → Select
Skip for now(we'll manually add AIGoCode) - Channels → Select
Telegram, enter your Bot Token - Enable hooks → Select all (especially
session-memory) - Install Gateway service →
Yes(auto-start on reboot) - Hatch your bot →
Do this later
Step 4: Add AIGoCode Model Config
Open the config file:
nano ~/.openclaw/openclaw.json
Insert inside the root object (replace with your real API Key):
"models": {
"providers": {
"aigocode": {
"baseUrl": "https://api.aigocode.com",
"apiKey": "sk-YOUR_AIGOCODE_API_KEY",
"api": "anthropic-messages",
"models": [
{
"id": "claude-opus-4-6",
"name": "Claude Opus 4.6 (AIGoCode)",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 16384
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "aigocode/claude-opus-4-6"
}
}
}
Note: If
agentsalready exists in the file, merge themodelkey into it — don't add a secondagentsblock.
Step 5: Restart the Gateway
openclaw gateway restart
openclaw gateway status # should show "active (running)"
Step 6: Pair with Telegram
Send any message to your bot. It will reply with a pairing code. Run in your terminal:
openclaw pairing approve telegram <YOUR_PAIRING_CODE>
Send another message — your bot is now live. Deployment complete.
Troubleshooting
| Error | Fix |
|---|---|
No API key found for provider anthropic | Check that models and agents in config are correct |
Port conflict (EADDRINUSE) | Run ss -tlnp | grep 18789 to find conflicting process |
openclaw: command not found | Run npm config get prefix and add the bin dir to $PATH |