What You'll Need
- A VPS (any provider—DigitalOcean, Linode, Hetzner, AWS)
- Ubuntu 22.04 LTS (recommended)
- SSH access
- A Telegram account
- An AI provider API key (we'll use free Kimi)
- Basic terminal knowledge (we'll explain each command)
Cost: $5-10/month for VPS + API usage
Time: 1-2 hours (first time), 30 min (if you know what you're doing)
Why Deploy on Your Own VPS?
Benefits:
- Complete control over your infrastructure
- Cheaper long-term ($5-10/mo vs $49/mo managed)
- Learn how OpenClaw works under the hood
- Customize everything
Drawbacks:
- You maintain everything yourself
- Need to handle security updates
- Troubleshooting is on you
- Takes 1-2 hours to set up
Step 1: Create Your VPS (10 minutes)
DigitalOcean (Recommended for Beginners)
- Go to digitalocean.com and create account
- Click "Create Droplet"
- Choose Ubuntu 22.04 LTS
- Select "Basic" plan
- Pick $6/month option (1 GB RAM, 1 vCPU—enough for OpenClaw)
- Choose region closest to you
- Add SSH key (or use password—we'll secure it later)
- Click "Create Droplet"
Alternative providers:
- Linode: Similar pricing, great support
- Hetzner: Cheapest ($4/mo), EU-based
- Vultr: More datacenter locations
All providers work the same. Pick whichever you prefer.
Step 2: Connect to Your VPS (5 minutes)
On Mac/Linux:
ssh root@your-vps-ip
On Windows:
Use PuTTY or Windows Terminal with WSL.
You'll see something like:
Welcome to Ubuntu 22.04 LTS
root@openclaw:~#
You're in. Now we install OpenClaw.
Step 3: Install Node.js (5 minutes)
OpenClaw runs on Node.js. Install it:
# Update package list
apt update && apt upgrade -y
# Install Node.js 20.x (LTS)
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
# Verify installation
node --version # Should show v20.x.x
npm --version # Should show 10.x.x
Why Node 20? OpenClaw requires Node 18+ for modern JavaScript features.
Step 4: Install OpenClaw (7 minutes)
# Clone OpenClaw repository
git clone https://github.com/openclaw/openclaw.git
cd openclaw
# Install dependencies
npm install
# Build the project
npm run build
This takes 3-5 minutes. You'll see a bunch of package names scroll by. That's normal.
If you see errors: Check Node version. Needs to be 18+.
Step 5: Configure OpenClaw (10 minutes)
# Copy example config
cp config.example.json config.json
# Edit with nano (or vim if you prefer)
nano config.json
Key settings to change:
{
"gateway": {
"host": "localhost", // IMPORTANT: localhost only for security
"port": 3000
},
"telegram": {
"botToken": "YOUR_BOT_TOKEN_HERE" // Get from @BotFather
},
"ai": {
"provider": "nvidia", // Free Kimi via Nvidia
"apiKey": "nvapi-...", // Your Nvidia API key
"model": "kimi-k2.5"
}
}
Security note: Always set host: "localhost". Never expose to 0.0.0.0 without authentication.
Save with: Ctrl+X, then Y, then Enter
Step 6: Get Your Telegram Bot Token (10 minutes)
- Open Telegram, search for @BotFather
- Send
/newbot - Choose a name: "My OpenClaw Bot"
- Choose a username: "myopenclaw_bot" (must end in _bot)
- Copy the token (looks like:
1234567890:ABCdefGHIjklMNOpqrsTUVwxyz) - Paste it in config.json under
telegram.botToken
Step 7: Get Free AI Credits (Kimi via Nvidia) (10 minutes)
Why Kimi? 50,000 free tokens/day. No credit card required.
- Go to build.nvidia.com/moonshot
- Sign up with email
- Click "Get API Key"
- Copy the key (starts with
nvapi-...) - Paste in config.json under
ai.apiKey
Alternative: Use Claude or GPT
- Claude: console.anthropic.com (paid)
- GPT: platform.openai.com (paid)
Step 8: Start OpenClaw (2 minutes)
# Start in foreground (to test)
npm start
You should see:
[gateway] gateway listening on localhost:3000
[telegram] starting provider
[telegram] bot connected: @your_bot_name
Test it: Message your bot on Telegram. It should reply.
If it works, press Ctrl+C to stop. We'll make it run 24/7 next.
Step 9: Make It Run 24/7 with PM2 (5 minutes)
# Install PM2 (process manager)
npm install -g pm2
# Start OpenClaw with PM2
pm2 start npm --name "openclaw" -- start
# Make it start on boot
pm2 startup
pm2 save
Useful PM2 commands:
pm2 status # Check if running
pm2 logs openclaw # View logs
pm2 restart openclaw # Restart
pm2 stop openclaw # Stop
Step 10: Security Hardening (10 minutes)
CRITICAL: Don't skip this step.
10.1: Set Up Firewall (UFW)
# Install UFW
apt install ufw
# Default rules: deny incoming, allow outgoing
ufw default deny incoming
ufw default allow outgoing
# Allow SSH (otherwise you'll lock yourself out)
ufw allow 22/tcp
# Enable firewall
ufw enable
# Check status
ufw status
10.2: Install fail2ban (Blocks Brute Force)
apt install fail2ban
systemctl enable fail2ban
systemctl start fail2ban
10.3: Create Non-Root User
# Create user
useradd -m openclaw
# Add to sudo group
usermod -aG sudo openclaw
# Switch to this user for running OpenClaw
su - openclaw
Why? Running as root is dangerous. If OpenClaw gets compromised, attacker has full system access.
Step 11: Verify Everything Works (5 minutes)
Checklist:
- [ ] VPS is running
- [ ] Node.js installed (version 20+)
- [ ] OpenClaw cloned and built
- [ ] config.json configured
- [ ] Telegram bot token added
- [ ] AI provider (Kimi) connected
- [ ] PM2 running OpenClaw 24/7
- [ ] Firewall (UFW) active
- [ ] fail2ban protecting SSH
Test: Message your Telegram bot. Should reply instantly.
Common Issues & Fixes
"Bot not responding"
# Check if OpenClaw is running
pm2 status
# Check logs for errors
pm2 logs openclaw
# Verify Telegram token
curl https://api.telegram.org/bot<YOUR_TOKEN>/getMe
"API key invalid"
- Check you copied the full key
- Ensure no extra spaces in config.json
- Verify key hasn't expired (Nvidia keys don't expire, but check dashboard)
"Gateway connection refused"
# Check if port 3000 is listening
netstat -tlnp | grep 3000
# Restart OpenClaw
pm2 restart openclaw
"npm install" fails
- Check Node version:
node --version(needs 18+) - Try:
npm install --legacy-peer-deps - Clear cache:
npm cache clean --force
Maintenance Tips
Weekly:
- Check PM2 status:
pm2 status - View logs for errors:
pm2 logs openclaw --lines 50
Monthly:
- Update system:
apt update && apt upgrade -y - Update OpenClaw:
cd openclaw && git pull && npm install && npm run build && pm2 restart openclaw
Check disk space:
df -h
If / is above 80%, clean logs:
pm2 flush openclaw
Upgrading to Paid AI Models
Free Kimi is great to start, but has limits (50k tokens/day).
When you need more:
Add Claude API
- Get key from console.anthropic.com
- Update config.json:
"ai": {
"provider": "anthropic",
"apiKey": "sk-ant-...",
"model": "claude-opus-4.5"
}
- Restart:
pm2 restart openclaw
Switch to GPT
"ai": {
"provider": "openai",
"apiKey": "sk-proj-...",
"model": "gpt-5.2"
}
Next Steps
Your OpenClaw is running. Now what?
- Add more channels: Discord, Email, WhatsApp
- Enable browser automation: Let it browse the web
- Set up web search: Connect to Google/Bing API
- Create custom skills: Teach it new abilities
- Backup config:
cp config.json config.backup.json
When Manual Setup Isn't Worth It
If this guide feels overwhelming, or you don't want to maintain a VPS yourself, consider the managed option.
5-minute automated deploy: open-claw.space
- No terminal required
- Security handled automatically
- Automatic updates
- $49/mo (includes $15 AI credits)
Most people do manual setup once to learn how it works, then realize maintaining it isn't worth their time.
Resources
- OpenClaw Docs: docs.openclaw.ai
- Community: GitHub Discussions
- Free AI (Nvidia): build.nvidia.com
Last updated: February 2026