How to Install Clawdbot on a VPS
How to Install Clawdbot on a VPS
Clawdbot is an open-source, self-hosted personal AI assistant that connects to your favorite messaging platforms. Unlike cloud-based AI assistants like ChatGPT, Clawdbot runs entirely on your infrastructure, giving you complete control over your data and privacy. In this article, we'll guide you through the installation process of Clawdbot on a VPS using Node.js. We recommend using LightNode as your VPS provider.
What is Clawdbot?
Clawdbot is a powerful personal AI assistant that lives inside your favorite apps and messaging platforms. It connects to WhatsApp, Telegram, Discord, Slack, Signal, iMessage, Microsoft Teams, Google Chat, and more, transforming Large Language Models into a truly personal, always-available companion. Key features include:
- Multi-platform Support: Works across 10+ messaging platforms
- Persistent Memory: Remembers your preferences and past conversations over time
- Proactive Actions: Can take actions, set reminders, and send notifications
- Self-hosted: Complete data ownership and privacy control
- Customizable: Extensible with skills and tools
- Always-on: Runs 24/7 on your VPS or local machine
Prerequisites
Before you begin, ensure you have the following:
- A VPS Server: You can choose from various cloud service providers. We recommend LightNode for its excellent performance and global coverage.
- Basic Command Line Knowledge: Familiarity with terminal commands will be helpful.
- Node.js Installed: Ensure Node.js 22 or higher is installed on your server.
- Minimum System Requirements: 2GB RAM, 1 vCPU, 10GB disk space (4GB RAM recommended for production use).
Why We Recommend LightNode VPS
LightNode is an excellent choice for hosting Clawdbot for several reasons:
Key Benefits of LightNode
- Affordable Pricing: Plans start at $7.71/month with hourly billing, allowing you to test without long-term commitments.
- 40+ Global Locations: Data centers across 6 continents including USA, Europe, Asia, Middle East, and Africa, ensuring low latency for users worldwide.
- High Performance: NVMe SSD storage and high-frequency CPUs provide excellent performance for AI workloads.
- 99.95% Uptime Guarantee: Reliable infrastructure with local BGP access ensures your assistant is always available.
- Flexible Billing: Pay only for what you use with hourly billing, perfect for testing and scaling.
- Developer-Friendly: Full root access, instant deployment, and support for both Linux and Windows.
- Free Snapshots: One free snapshot per VPS for easy backups and recovery.
- New User Bonus: Get up to $15 in free credits on your first recharge.
Recommended LightNode Configuration for Clawdbot
| Component | Specification | Monthly Cost |
|---|---|---|
| Plan | Agency | $14.70/month |
| CPU | 2 vCPU | - |
| RAM | 4GB DDR4 | - |
| Storage | 50GB NVMe SSD | - |
| Bandwidth | 2TB | - |
| Location | Singapore, Hong Kong, or Silicon Valley | - |
This configuration provides sufficient resources for Clawdbot's operations and allows room for growth as your usage increases.
Step 1: Setting Up Your VPS
Launch Instance: Sign in to LightNode and create a new VPS instance. We recommend choosing a location close to your primary users for optimal latency. For global access, Singapore or Hong Kong are excellent choices for Asian users, while Silicon Valley works well for North American users.
Choose Operating System: Select Ubuntu 22.04 LTS (recommended) or Ubuntu 24.04. These versions have excellent Node.js support and are widely tested.
SSH Access: Use an SSH client to gain access to your server:
ssh username@your_server_ip
Step 2: Installing Node.js
Clawdbot requires Node.js version 22 or higher. Here's how to install it on Ubuntu:
# Update package lists
sudo apt update
# Install Node.js 22 from NodeSource repository
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
# Verify installation
node --version
# Should output: v22.x.xAlternatively, you can use NVM (Node Version Manager) for more flexibility:
# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
# Install Node.js 22
nvm install 22
nvm use 22
# Verify installation
node --versionStep 3: Installing Clawdbot
There are multiple installation methods available. Choose the one that best fits your needs.
Method 1: Official Installer Script (Recommended for Beginners)
The installer script is the easiest method and automatically handles dependencies:
# Download and run the installer
curl -fsSL https://clawd.bot/install.sh | bashThis command will:
- Detect your operating system
- Ensure Node.js 22+ is installed
- Install Clawdbot globally via npm
- Set up the necessary paths
- Run the doctor command to verify installation
Method 2: npm Global Install
For users comfortable with npm:
# Install Clawdbot globally
npm install -g clawdbot@latest
# Or using pnpm (faster)
pnpm add -g clawdbot@latest
# Verify installation
clawdbot --versionMethod 3: Install from Source (For Developers)
# Clone the repository
git clone https://github.com/clawdbot/clawdbot.git
cd clawdbot
# Install dependencies
pnpm install
# Build the UI
pnpm ui:build
# Build the project
pnpm build
# Run the onboarding wizard
./dist/entry.js onboard --install-daemonMethod 4: Docker Install (Optional)
For containerized deployment:
# Clone the repository
git clone https://github.com/clawdbot/clawdbot.git
cd clawdbot
# Run the Docker setup script
./docker-setup.shStep 4: Running the Onboarding Wizard
After installation, run the onboarding wizard to configure Clawdbot:
# Start the interactive onboarding wizard
clawdbot onboard --install-daemonThe wizard will guide you through:
- Gateway Configuration: Choose local or remote gateway mode and set up the gateway port (default: 18789).
- Authentication Setup: Configure your AI model provider.
- Anthropic (Claude): API key or OAuth (recommended)
- OpenAI (ChatGPT/Codex): API key
- Other Providers: Custom endpoints and API keys
- Channel Configuration: Set up messaging platforms:
- WhatsApp: QR code login
- Telegram: Bot token from @BotFather
- Discord: Bot token from Discord Developer Portal
- Slack: OAuth or bot token
- Service Installation: Install the Gateway as a background service (systemd on Linux).
- Agent Identity: Set up your assistant's personality and default behavior.
Step 5: Starting the Gateway
After completing the onboarding wizard, the Gateway should start automatically. You can check its status with:
# Check gateway status
clawdbot gateway status
# View logs
clawdbot logs --follow
# Check health
clawdbot healthManual Start (if service not running)
# Start gateway in foreground
clawdbot gateway --port 18789 --verboseManaging the Service
# Start the service
systemctl --user start clawdbot-gateway.service
# Stop the service
systemctl --user stop clawdbot-gateway.service
# Restart the service
systemctl --user restart clawdbot-gateway.service
# Enable service to start on boot
systemctl --user enable clawdbot-gateway.service
# View service logs
journalctl --user -u clawdbot-gateway -fStep 6: Accessing the Dashboard
The Clawdbot Control UI is accessible via your web browser:
http://your_server_ip:18789/If you have set up authentication during the onboarding wizard, you'll need to provide the gateway token to access the dashboard.
Remote Access via SSH Tunnel
For secure remote access:
# Set up SSH tunnel from your local machine
ssh -N -L 18789:127.0.0.1:18789 username@your_server_ip
# Then access locally
http://localhost:18789/Step 7: Connecting Your First Channel
To connect WhatsApp:
# Generate and display QR code
clawdbot channels login
# Scan with WhatsApp:
# Settings → Linked Devices → Link a DeviceAfter scanning, your WhatsApp will connect to Clawdbot.
Telegram
- Create a bot by messaging @BotFather on Telegram
- Follow the prompts to create a new bot
- Copy the bot token provided
- Add the bot to Clawdbot:
clawdbot channels add --channel telegram --token "your_bot_token_here"Discord
- Go to the Discord Developer Portal
- Create a new application
- Enable the bot under the "Bot" tab
- Copy the bot token
- Invite the bot to your Discord server with appropriate permissions
- Add to Clawdbot:
clawdbot channels add --channel discord --token "your_discord_bot_token"Step 8: Configuring DM Safety
By default, Clawdbot uses a pairing mode for direct messages, meaning unknown senders receive a pairing code and their messages aren't processed until approved.
# List pending pairing requests
clawdbot pairing list whatsapp
# Approve a pairing request
clawdbot pairing approve whatsapp <pairing_code>
# View approved pairings
clawdbot pairing list whatsapp --approvedYou can modify this behavior in the configuration file at ~/.clawdbot/clawdbot.json.
Step 9: Testing Your Setup
Send a test message to verify everything is working:
# Send a test message
clawdbot message send --to +15555550123 --message "Hello from Clawdbot!"
# Or test via Telegram
clawdbot message send --to @your_telegram_username --message "Hello!"Alternatively, send a message directly to your connected WhatsApp/Telegram/Discord, and your Clawdbot assistant should respond.
Step 10: Configuring Nginx (Optional)
For production use, we recommend setting up a reverse proxy with Nginx to enhance security and manage SSL certificates.
Install Nginx
sudo apt install -y nginxConfigure Nginx
Edit the Nginx configuration file:
sudo nano /etc/nginx/sites-available/clawdbotAdd the following configuration:
server {
listen 80;
server_name your-domain.com; # Replace with your domain
location / {
proxy_pass http://localhost:18789;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}Enable the Configuration
# Create symbolic link
sudo ln -s /etc/nginx/sites-available/clawdbot /etc/nginx/sites-enabled/
# Test Nginx configuration
sudo nginx -t
# Restart Nginx
sudo systemctl restart nginxAdding SSL with Certbot (Recommended)
# Install Certbot
sudo apt install -y certbot python3-certbot-nginx
# Obtain SSL certificate
sudo certbot --nginx -d your-domain.com
# Certbot will automatically configure Nginx with SSLAfter this, your Clawdbot will be accessible at:
https://your-domain.com/Troubleshooting Common Issues
Gateway Won't Start
If the gateway fails to start:
# Check for configuration errors
clawdbot doctor
# View detailed logs
journalctl --user -u clawdbot-gateway -n 50Out of Memory Errors
On VPS with 2GB RAM, you might encounter out-of-memory errors during updates. Add a swap file:
# Create a 2GB swap file
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Make swap persistent
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstabPort Already in Use
If port 18789 is already in use:
# Find what's using the port
sudo lsof -i :18789
# Or use a different port
clawdbot gateway --port 18889Bot Not Responding
If your bot isn't responding:
- Check Gateway Status:
clawdbot gateway status - Verify Channel Configuration: Ensure tokens are correct and channels are enabled
- Check Authentication: Verify API keys are valid
- Review Logs:
clawdbot logs --followto look for error messages
Updating Clawdbot
To update to the latest version:
# Re-run the installer
curl -fsSL https://clawd.bot/install.sh | bash
# Or update via npm
npm update -g clawdbot@latest
# Restart the gateway
clawdbot gateway restart
# Verify health
clawdbot healthConclusion
Installing Clawdbot on a VPS is a straightforward process that gives you a powerful, self-hosted AI assistant accessible across multiple messaging platforms. With LightNode's affordable pricing, global coverage, and high-performance infrastructure, you can deploy your personal AI assistant with confidence.
By following this guide, you should have Clawdbot running on your VPS in about 20-30 minutes, providing you with an always-available AI companion that respects your privacy and gives you complete control over your data.
For further customization and advanced features, refer to the official documentation on the Clawdbot GitHub page and explore community discussions for additional insights and tips.
Additional Resources
- Clawdbot Official Documentation
- Clawdbot GitHub Repository
- LightNode VPS - Recommended VPS Provider
- Clawdbot Community Discord
- Skills Marketplace - Extend your assistant with additional skills