Run Nanobot AI on a VPS — Setup Guide (Under 5 Min)
Deploy Nanobot on your VPS with Docker in under 5 minutes. Includes Telegram bot setup, provider picks, and copy-paste commands. From $4.99/mo.
How to Run Nanobot AI Assistant on a VPS
Nanobot is an ultra-lightweight personal AI assistant (just ~3,400 lines of code!) inspired by OpenClaw. It’s perfect for self-hosting on a cheap VPS - you get your own 24/7 AI assistant accessible via Telegram, Discord, or WhatsApp. This guide walks you through the complete setup.
What is Nanobot?
What is Nanobot?
🐈 Nanobot is a minimalist AI agent that packs serious power into a tiny package:
- Ultra-Lightweight: 99% smaller than full-featured alternatives
- Multi-Channel: Chat via Telegram, Discord, WhatsApp, or Feishu
- Tool-Enabled: Web search, code execution, file management
- Scheduled Tasks: Automate daily routines
- Memory: Remembers context across conversations
- Local LLM Support: Run with vLLM for complete privacy
GitHub: github.com/HKUDS/nanobot
VPS Requirements
Nanobot is lightweight, so you don’t need much:
| Requirement | Minimum | Recommended |
|---|---|---|
| RAM | 1GB | 2GB |
| CPU | 1 vCPU | 2 vCPU |
| Storage | 10GB | 20GB |
| OS | Ubuntu 22.04 | Ubuntu 24.04 |
| Python | 3.10+ | 3.12 |
Best Budget VPS Options:
- Hostinger KVM1: $4.99/mo (4GB RAM) ⭐ Best Value
- Hetzner CX22: €3.79/mo (2 vCPU, 4GB RAM)
- Vultr Cloud: $5/mo (1 vCPU, 1GB RAM)
Step 1: Initial Server Setup
SSH into your new VPS and run these commands:
# Update system
sudo apt update && sudo apt upgrade -y
# Install Python and pip
sudo apt install python3 python3-pip python3-venv -y
# Install uv (fast Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc
Step 2: Install Nanobot
Choose one of these installation methods:
Option A: Using uv (Recommended)
uv tool install nanobot-ai
Option B: Using pip
pip install nanobot-ai
Option C: From Source (Latest Features)
git clone https://github.com/HKUDS/nanobot.git
cd nanobot
pip install -e .
Step 3: Initialize and Configure
Run the onboarding command:
nanobot onboard
This creates ~/.nanobot/config.json. Edit it with your API keys:
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-YOUR-KEY-HERE"
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-sonnet-4"
}
},
"tools": {
"web": {
"search": {
"apiKey": "BSA-YOUR-BRAVE-KEY"
}
}
}
}
Get API Keys:
- OpenRouter: openrouter.ai/keys (for LLM access)
- Brave Search: brave.com/search/api/ (optional, for web search)
Step 4: Test It Works
Run a quick test:
nanobot agent -m "Hello! What can you help me with?"
You should see a response from the AI. If it works, you’re ready for the next step!
Step 5: Connect Telegram Bot
The best way to chat with Nanobot is via Telegram:
1. Create a Telegram Bot:
- Open Telegram, search for @BotFather
- Send
/newbotand follow the prompts - Copy the bot token
2. Get Your User ID:
- Search for @userinfobot on Telegram
- It will show your numeric user ID
3. Update Config:
{
"channels": {
"telegram": {
"enabled": true,
"token": "YOUR_BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
}
}
4. Start the Gateway:
nanobot gateway
Now message your bot on Telegram - Nanobot will respond! 🎉
Step 6: Run as a Service (24/7)
To keep Nanobot running after you disconnect, create a systemd service:
sudo nano /etc/systemd/system/nanobot.service
Paste this:
[Unit]
Description=Nanobot AI Assistant
After=network.target
[Service]
Type=simple
User=YOUR_USERNAME
WorkingDirectory=/home/YOUR_USERNAME
ExecStart=/home/YOUR_USERNAME/.local/bin/nanobot gateway
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable nanobot
sudo systemctl start nanobot
Check status: sudo systemctl status nanobot
Don’t forget to secure your VPS before exposing it to the internet.
Docker Alternative
Prefer Docker? Here’s a quick setup:
# Create config directory
mkdir -p ~/.nanobot
# Create config.json with your settings
nano ~/.nanobot/config.json
# Run with Docker
docker run -d \
--name nanobot \
--restart always \
-v ~/.nanobot:/root/.nanobot \
ghcr.io/hkuds/nanobot:latest \
gateway
Check logs: docker logs -f nanobot
Cost Breakdown
Monthly Costs:
| Component | Cost |
|---|---|
| VPS (Hostinger) | $4.99 |
| OpenRouter API | ~$5-20 (usage-based) |
| Brave Search | Free tier available |
| Total | ~$10-25/mo |
Tips to Reduce Costs:
- Use
anthropic/claude-haikufor simple tasks (~10x cheaper) - Use
minimax/minimax-m2for budget option - Run local LLM with vLLM for $0 API costs (needs 8GB+ RAM VPS)
FAQ
What’s the difference between Nanobot and OpenClaw?
Nanobot is inspired by OpenClaw but 99% smaller (~3,400 lines vs 430k+ lines). It’s designed for simplicity and ease of modification, while OpenClaw offers more advanced features.
Can I run Nanobot on a $5 VPS?
Yes! Nanobot is very lightweight. A 1GB RAM VPS is enough for basic usage. For heavier workloads or multiple channels, get 2GB+ RAM.
Which LLM model should I use?
For best results, use Claude claude-sonnet-4 or claude-opus-4-5 via OpenRouter. For budget usage, try minimax-m2 or run a local LLM with vLLM.
Is my data private?
Your conversations go through the LLM provider (OpenRouter/OpenAI). For complete privacy, run a local LLM using vLLM on a beefier VPS (8GB+ RAM) — see our best VPS for Ollama guide for local LLM hosting.
Can I use Discord or WhatsApp instead of Telegram?
Yes! Nanobot supports Telegram, Discord, WhatsApp, and Feishu. Check the GitHub repo for channel-specific setup instructions.
Ready to get started?
Get the best VPS hosting deal today. Hostinger offers 4GB RAM VPS starting at just $4.99/mo.
Get Hostinger VPS — $4.99/mo// up to 75% off + free domain included
// related topics
// related guides
Best VPS for OpenClaw: Self-Host Your AI Assistant in 2026
Looking for the best VPS to host OpenClaw? We compare top providers for running your own AI assistant gateway with WhatsApp, Telegram, and Discord integration.
tutorial$1 VPS Hosting 2026: Cheapest VPS Servers Starting at $1/Month
Looking for $1 VPS hosting? Compare the cheapest VPS providers starting from $1-3/month. Real specs, no hidden fees, honest reviews of budget VPS options.
tutorialCaddy Reverse Proxy Guide 2026: Automatic HTTPS Made Easy
Set up Caddy as a reverse proxy with automatic HTTPS, zero-config SSL, and simple Caddyfile syntax. Complete VPS deployment guide.
tutorialCloudflare Tunnel VPS Guide 2026: Expose Services Without Opening Ports
Set up Cloudflare Tunnel on your VPS to expose web apps securely without opening ports or revealing your server IP. Complete guide with Docker and DNS config.
Andrius Putna
I am Andrius Putna. Geek. Since early 2000 in love tinkering with web technologies. Now AI. Bridging business and technology to drive meaningful impact. Combining expertise in customer experience, technology, and business strategy to deliver valuable insights. Father, open-source contributor, investor, 2xIronman, MBA graduate.
// last updated: February 6, 2026. Disclosure: This article may contain affiliate links.