Introduction Running Openclaw (formerly Moltbot/Clawdbot) efficiently requires more than just code—it requires a server that can handle high-speed data processing without lag. Many users struggle with sluggish performance on shared hosting.
sudo apt-get update && sudo apt-get upgrade -yNow that your Bluehost server is ready, we will install the Openclaw software. You have two options to do this. Method A is recommended because it keeps your server clean using containers, but Method B is faster if you just want to get it running directly.
Method A: The Docker Setup (Recommended for Stability)
This method uses the official setup script to run Openclaw inside a container, ensuring no conflicts with other software on your server.
1. Install Git and Docker: First, ensure your system has the necessary tools. Run these commands:
sudo apt-get update
sudo apt-get install -y git docker.io docker-compose-v2
2. Clone and Run the Setup Wizard: We will pull the official repository and launch the interactive setup.
mkdir -p ~/openclaw-assistant && cd ~/openclaw-assistant
git clone https://github.com/openclaw/openclaw.git .
./docker-setup.sh
3. Follow the On-Screen Prompts: The script will ask you a series of questions. Here is what to select:
- Security Acknowledgment: Type
yoryes. - Model Provider: Select your AI provider (e.g., OpenAI, Anthropic, or Vultr Serverless Inference).
- API Key: Paste your API key when prompted.
- Channels: Choose where you want your bot to live (Telegram, Discord, Slack, etc.).
Once finished, the gateway will start automatically.
Method B: The Direct Installation (Fastest)
If you prefer running the software natively on Linux without Docker, use this method.
1. Prepare the Environment (Node.js 22+): Openclaw requires a modern version of Node.js. Install it with these commands:
# Install Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs build-essential
# Enable pnpm (Package Manager)
sudo corepack enable
2. Run the Auto-Installer: Use the official one-line installer script:
curl -fsSL https://openclaw.bot/install.sh | bash
3. Configure and Start: Once installed, run the onboarding command to configure your bot and set it to run in the background (daemon mode):
openclaw onboard --install-daemon
(Note: If the openclaw command isn't found, try source ~/.bashrc to refresh your path, or use the legacy command clawdbot).
⚠️ Important: Prevent Crashes with Swap Memory
If you are using the $9.99 Bluehost VPS (2GB RAM), the installation process might fail due to "Out of Memory" (OOM) errors. To prevent this, run these commands before installing to add 4GB of virtual memory (Swap):
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
This simple trick ensures your server handles the installation smoothly without needing a more expensive plan.
No comments:
Post a Comment