AgentSkillsCN

clawdbot-setup

全面指导如何在VPS上部署Clawdbot AI助手。涵盖服务器选型、操作系统特定的安装与配置、守护进程的搭建,以及与Telegram、WhatsApp、Gmail等平台的集成。

SKILL.md
--- frontmatter
name: clawdbot-setup
description: Comprehensive guide for deploying Clawdbot AI Assistant on a VPS. Covers server selection, OS-specific installation, configuration, daemon setup, and integrations (Telegram, WhatsApp, Gmail).
version: 0.1.0

Clawdbot Setup Guide

Deploy your own AI assistant on a cheap VPS for under $5/month.

What is Clawdbot?

Clawdbot is an AI assistant that can:

  • Manage your Gmail with automated responses
  • Run Telegram/WhatsApp bots
  • Transcribe voice messages
  • Perform research and trend analysis
  • Remember context across conversations
  • Run 24/7 unattended on a server

Quick Start

Which platform are you on?

PlatformCommand
Linuxcurl -fsSL --proto '=https' --tlsv1.2 https://raw.githubusercontent.com/moinsen-dev/clawdbot-easy-setup/main/install.sh | bash
macOScurl -fsSL --proto '=https' --tlsv1.2 https://raw.githubusercontent.com/moinsen-dev/clawdbot-easy-setup/main/install-macos.sh | bash
Windowsiwr -useb https://raw.githubusercontent.com/moinsen-dev/clawdbot-easy-setup/main/install.ps1 | iex

That's it! The wizard guides you through the rest.


Decision Tree

Do you have a VPS/server already?


Server Selection

Recommended: Hetzner Cloud (~$4.51/month)

Best value for European users. Steps:

  1. Go to console.hetzner.cloud
  2. Create an account (email verification required)
  3. Create a new project
  4. Click "Add Server" with these settings:
SettingRecommended Value
LocationFalkenstein, DE (cheapest)
ImageUbuntu 24.04
TypeCX22 (2 vCPU, 4GB RAM)
SSH KeyAdd your public key
Price~4.51 EUR/month
  1. Note the server IP address after creation

Alternative Providers

ProviderPlanPriceNotes
DigitalOceanBasic Droplet 2GB$12/monthEasy UI
VultrCloud Compute 2GB$12/monthMany locations
LinodeNanode 2GB$12/monthGood support
Oracle CloudAlways Free$0/monthComplex setup

SSH Key Setup

If you don't have an SSH key:

bash
# Generate new key
ssh-keygen -t ed25519 -C "your@email.com"

# View public key (copy this to Hetzner)
cat ~/.ssh/id_ed25519.pub

Installation

Step 1: Connect to Your Server

bash
ssh root@YOUR_SERVER_IP

Step 2: Create Non-Root User (Recommended)

bash
# Create user
adduser clawdbot

# Grant sudo access
usermod -aG sudo clawdbot

# Switch to new user
su - clawdbot

Step 3: Update System

bash
sudo apt update && sudo apt upgrade -y

Step 4: Run Installer

Linux (Ubuntu/Debian):

bash
curl -fsSL --proto '=https' --tlsv1.2 \
  https://raw.githubusercontent.com/moinsen-dev/clawdbot-easy-setup/main/install.sh | bash

macOS:

bash
curl -fsSL --proto '=https' --tlsv1.2 \
  https://raw.githubusercontent.com/moinsen-dev/clawdbot-easy-setup/main/install-macos.sh | bash

Windows (PowerShell as Administrator):

powershell
iwr -useb https://raw.githubusercontent.com/moinsen-dev/clawdbot-easy-setup/main/install.ps1 | iex

Install Options

bash
# Non-interactive (for automation/CI)
curl ... | bash -s -- --no-onboard --no-prompt

# Specific version
curl ... | bash -s -- --version 1.2.3

# Beta version
curl ... | bash -s -- --beta

# Dry run (preview only)
curl ... | bash -s -- --dry-run

# Verbose output
curl ... | bash -s -- --verbose

Configuration

API Keys Setup

Create the environment file:

bash
mkdir -p ~/.clawdbot
nano ~/.clawdbot/.env

Add your API keys:

bash
# AI Provider (at least one required)
ANTHROPIC_API_KEY=sk-ant-api03-...
OPENAI_API_KEY=sk-...

# Telegram Bot (optional)
TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz

# Gmail (optional)
GMAIL_ADDRESS=your-bot@gmail.com
GMAIL_APP_PASSWORD=xxxx xxxx xxxx xxxx

Verify Installation

bash
# Check version
clawdbot --version

# Run health check
clawdbot doctor

Daemon Setup (24/7 Operation)

Using Built-in Daemon Manager

bash
# Install as system service
clawdbot daemon install

# Start the daemon
clawdbot daemon start

# Check status
clawdbot daemon status

# View logs
clawdbot daemon logs

# Restart (after updates)
clawdbot daemon restart

# Stop
clawdbot daemon stop

Manual systemd Service

If the built-in daemon doesn't work:

bash
sudo nano /etc/systemd/system/clawdbot.service
ini
[Unit]
Description=Clawdbot AI Assistant
After=network.target

[Service]
Type=simple
User=clawdbot
WorkingDirectory=/home/clawdbot
ExecStart=/usr/bin/node /usr/lib/node_modules/clawdbot/dist/entry.js daemon
Restart=always
RestartSec=10
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target
bash
sudo systemctl daemon-reload
sudo systemctl enable clawdbot
sudo systemctl start clawdbot
sudo systemctl status clawdbot

Integrations

Telegram Bot

  1. Open Telegram and message @BotFather
  2. Send /newbot
  3. Choose a name and username for your bot
  4. Copy the token (looks like 123456789:ABCdef...)
  5. Run:
    bash
    clawdbot integrations add telegram
    
  6. Paste the token when prompted

WhatsApp

Note: Requires display for QR code scanning.

Options:

  • SSH with X forwarding: ssh -X user@server
  • Use Hetzner web console
  • Set up VNC for remote desktop
bash
clawdbot integrations add whatsapp
# QR code appears - scan with WhatsApp mobile app

Gmail

  1. Enable 2-Factor Authentication on your Google account
  2. Go to myaccount.google.com/apppasswords
  3. Select "Mail" and your device
  4. Copy the 16-character App Password
  5. Run:
    bash
    clawdbot integrations add gmail
    
  6. Enter your Gmail address and App Password

Maintenance

Updates

bash
# Check for updates
clawdbot update --check

# Update Clawdbot
clawdbot update

# Update and restart daemon
clawdbot update --restart

Backup

bash
# Create backup
tar -czvf clawdbot-backup-$(date +%Y%m%d).tar.gz ~/.clawdbot

# Restore
tar -xzvf clawdbot-backup-YYYYMMDD.tar.gz -C ~/

View Logs

bash
# Daemon logs
clawdbot daemon logs

# Follow in real-time
clawdbot daemon logs -f

# System logs (systemd)
sudo journalctl -u clawdbot -f

Troubleshooting

"clawdbot: command not found"

bash
# Refresh shell cache
hash -r

# Check if installed
which clawdbot || npm list -g clawdbot

# Add to PATH
export PATH="$HOME/.npm-global/bin:$PATH"
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Permission Denied (npm)

bash
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH="$HOME/.npm-global/bin:$PATH"

Out of Memory (2GB VPS)

Add swap space:

bash
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Daemon Won't Start

bash
# Check diagnostics
clawdbot doctor

# Check port conflicts
sudo lsof -i :3000

# View detailed logs
clawdbot daemon logs --verbose

# Manual start to see errors
node /usr/lib/node_modules/clawdbot/dist/entry.js daemon

Firewall Issues

bash
# Check firewall status
sudo ufw status

# Allow required ports
sudo ufw allow 22/tcp    # SSH
sudo ufw allow 3000/tcp  # Clawdbot (if using web UI)
sudo ufw enable

Security Checklist

  • Using SSH key authentication (not password)
  • Root login disabled (PermitRootLogin no in sshd_config)
  • Firewall configured (ufw)
  • fail2ban installed (sudo apt install fail2ban)
  • API keys stored in .env file (not in config)
  • Regular backups of ~/.clawdbot
  • Running as non-root user

Cost Summary

ItemMonthly Cost
Hetzner CX22~$4.51
Domain (optional)~$1
Total~$5.50

Comparison: Mac Mini M4 at $800 = 145+ months of VPS hosting.


Resources