How to Install OpenClaw on a VPS: Complete Guide
Step-by-step guide to installing and configuring OpenClaw (formerly Clawd.bot) on your VPS server. Covers Ubuntu, Debian, and Docker setups with best practices.
Introduction
Setting up OpenClaw on a VPS gives you full control over your AI chatbot deployment. This guide walks you through the complete installation process on a Linux VPS.
OpenClaw (formerly known as Clawd.bot and briefly Moltbot) is a powerful, self-hosted AI agent framework with autonomous capabilities, persistent memory, and a skills system.
Prerequisites
Before starting, ensure you have:
- A VPS with at least 2GB RAM and 2 CPU cores
- Ubuntu 22.04 or Debian 12 installed
- Root or sudo access
- A domain name (optional but recommended)
Step 1: Update Your Server
First, update your server's package list and upgrade existing packages:
sudo apt update && sudo apt upgrade -y
Install essential tools:
sudo apt install -y curl wget git build-essential
Step 2: Install Node.js
OpenClaw requires Node.js 18 or higher. Install it using the NodeSource repository:
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
Verify the installation:
node --version
npm --version
Step 3: Install Git
sudo apt install git -y
Step 4: Clone OpenClaw
Navigate to your preferred directory and clone the repository:
cd /opt
sudo git clone https://github.com/nicepkg/openclaw.git
cd openclaw
Step 5: Install Dependencies
sudo npm install
Step 6: Configure Environment Variables
Copy the example environment file and edit it:
sudo cp .env.example .env
sudo nano .env
Configure your API keys and settings:
ANTHROPIC_API_KEY- Your Anthropic API keyDISCORD_TOKEN- Your Discord bot token (if using Discord)BOT_PREFIX- Command prefix (default: !)
Step 7: Set Up PM2 for Process Management
Install PM2 globally to keep your bot running:
sudo npm install -g pm2
pm2 start index.js --name openclaw
pm2 save
pm2 startup
Step 8: Configure Firewall
Allow necessary ports through your firewall:
sudo ufw allow 22/tcp
sudo ufw allow 443/tcp
sudo ufw enable
Step 9: Security Hardening
Create a dedicated user
sudo useradd -r -s /bin/false openclaw
sudo chown -R openclaw:openclaw /opt/openclaw
Verification
Check that your bot is running:
pm2 status
pm2 logs openclaw
Next Steps
Now that OpenClaw is installed, you should:
Need Help?
If you encounter issues or prefer professional setup, contact us for expert assistance. We offer complete VPS setup and ongoing maintenance services.
Need a VPS for Your Bot?
We recommend Hostinger KVM 2 VPS - reliable, fast, and perfect for AI chatbots. Get started with our recommended setup.
Get Hostinger VPSNeed Help With Setup?
Got your VPS? Let us handle the technical work. Professional setup and maintenance for OpenClaw (formerly Clawd.bot).