How to Run Nanobot AI on a VPS: Complete 2026 Setup Guide
TUTORIAL 12 min read fordnox

How to Run Nanobot AI on a VPS: Complete 2026 Setup Guide

Step-by-step guide to deploy Nanobot, the ultra-lightweight AI assistant, on your VPS. Docker setup, Telegram integration, and best VPS recommendations.


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?

🐈 Nanobot is a minimalist AI agent that packs serious power into a tiny package:

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:

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:

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:

2. Get Your 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

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:

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).

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.

~/nanobot-vps-setup/get-started

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

nanobot vps setup nanobot ai hosting self-host ai assistant nanobot telegram lightweight ai agent vps

fordnox

Expert VPS reviews and hosting guides. We test every provider we recommend.

// last updated: February 6, 2026. Disclosure: This article may contain affiliate links.