How to Install and Secure OpenClaw (Moltbot) on a Cloud Server

Support

1. Overview

This guide explains how to deploy and secure OpenClaw (Moltbot) on a Cloud Virtual Machine.

By following this guide, you will:

  • Choose the appropriate Cloud plan.
  • Create a Virtual Machine.
  • Install OpenClaw.
  • Connect messaging channels.
  • Secure the installation for production use.

2. System Requirements

RequirementMinimumRecommended
CPU1 vCPU2 vCPU
Memory (RAM)1 GB4–8 GB
Storage500 MB20–30 GB
Operating SystemLinux (any)Ubuntu 22.04 or 24.04 LTS
RuntimeNode.js 22+Node.js 22 LTS
NetworkPublic IPv4Public IPv4 + Firewall

3. Create the Virtual Machine

  1. Log in to the Cloud dashboard.
  2. Navigate to Compute → Create VM.
  3. Select the required plan.
  4. Choose Ubuntu 22.04 LTS or Ubuntu 24.04 LTS.
  5. Add an SSH key or configure a root password.
  6. Create the Virtual Machine.
  7. Note the public IP address after deployment.

4. Install OpenClaw

Step 1: Update the System

Bash
sudo apt update && sudo apt upgrade -y
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash – && sudo apt install -y nodejs

Step 2: Configure Corepack

Bash
corepack enable
corepack prepare pnpm@latest –activate
pnpm setup
source ~/.bashrc

Step 3: Install npm

Bash
npm install -g npm@11.8.0
Verify the installation:
node –version
npm –version

Step 4: Install Docker

Bash
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER

Verify Docker:

Bash
docker –version

Step 5: Install OpenClaw

Bash
curl -fsSL https://openclaw.ai/install.sh | bash

Verify the installation:

Bash
openclaw –version

Open claw

Set up

Step 6: Run the Initial Configuration

openclaw onboard

Follow the prompts to configure:

  • AI provider
  • API key
  • Basic settings

Setup

Setup

6. Connect Communication Channels

Telegram

  1. Open Telegram.
  2. Search for @BotFather.
  3. Run /newbot.
  4. Copy the bot token.
  5. Paste the token when prompted by OpenClaw.

WhatsApp

Run:

Bash
openclaw channels login whatsapp

A QR code is displayed.

Open WhatsApp on your phone:

Linked Devices → Link a Device

Scan the QR code to complete the connection.

Configure the allowed users:

channels:
whatsapp:
allowFrom:
– “+91XXXXXXXXXX”
– “+91XXXXXXXXXX”

Slack

Create a Slack application.

Enable Socket Mode.

Configure the required Bot Token and App Token.

Add the tokens to the configuration:

channels:
slack:
botToken: “xoxb-your-bot-token-here”
appToken: “xapp-your-app-token-here”

Gmail

Configure Gmail by:

  • Creating a Google Cloud project.
  • Enabling the Gmail API.
  • Enabling the Pub/Sub API.
  • Creating a Service Account.
  • Creating a Pub/Sub topic and subscription.
  • Adding the credentials path to the OpenClaw configuration.

7. Secure the Installation

Enable Docker Sandboxing

Configure:

agents:
defaults:
sandbox:
mode: “non-main”

Configure the Cloud Firewall

Create firewall rules to:

  • Allow SSH only from trusted IP addresses.
  • Block the gateway port from public access.
  • Deny all other inbound traffic by default.

Configure UFW

Bash
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw enable
sudo ufw status

Access the Dashboard

Create an SSH tunnel:

Bash
ssh -L 18789:localhost:18789 moltbot-user@your-server-ip

Open:
http://localhost:18789/

If a gateway token is required, run:

Bash
openclaw dashboard –no-open

Use the generated URL to access the dashboard.

Configure Allowed Users

Example:

channels:
whatsapp:
allowFrom:
– “+91XXXXXXXXXX”

slack:
allowUsers:
– “U01XXXXXXXX”

Enable Automated Backups

Open the Cloud dashboard.

Navigate to:

Virtual Machine → Backups

Enable automated backups.

Run the Health Check

Bash
moltbot doctor

8. Run OpenClaw as a Service

Create the systemd service:

Bash
sudo tee /etc/systemd/system/openclaw.service

Reload systemd:

Bash
sudo systemctl daemon-reexec
sudo systemctl daemon-reload

Enable and start the service:

Bash
sudo systemctl enable openclaw
sudo systemctl start openclaw

Verify the service:

Bash
sudo systemctl status openclaw

View the logs:

Bash
journalctl -u openclaw -f

9. Troubleshooting

WhatsApp QR Code Does Not Appear

Verify that Node.js 22 or later is installed.

Bash
node –version

Slack Bot Does Not Respond

Verify that:

  • Socket Mode is enabled.
  • Bot Token and App Token are configured correctly.

High Memory Usage

If multiple communication channels are enabled with browser automation, consider upgrading the Virtual Machine to a larger plan.

Health Check Shows Warnings

Run:

Bash
moltbot doctor

Review each warning and apply the recommended corrections.