Skip to content

Instantly share code, notes, and snippets.

@amElnagdy
Created January 29, 2026 09:44
Show Gist options
  • Select an option

  • Save amElnagdy/06e0ccab9bfed0499a658a1d14786ed4 to your computer and use it in GitHub Desktop.

Select an option

Save amElnagdy/06e0ccab9bfed0499a658a1d14786ed4 to your computer and use it in GitHub Desktop.
Moltbot VPS Setup Guide

Moltbot VPS Setup Guide

Your Personal AI Assistant on a VPS — The Actual Commands We Used

By Ahmed Nagdy | NagdyWP


What We Built

A self-hosted Moltbot instance that:

  • Runs 24/7 on a Contabo VPS
  • Connects via Telegram
  • Uses GLM-4.7 as the LLM
  • Can be extended with skills and GitHub integration

Part 1: Initial Server Setup

Connect to Your Server

ssh root@YOUR_SERVER_IP

Update System

apt update && apt upgrade -y

Install Essentials

apt install -y build-essential curl wget git unzip htop tmux ufw

Create a Non-Root User

adduser nagdy
usermod -aG sudo nagdy
su - nagdy

Configure Swap (4GB)

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

Verify:

free -h

Part 2: Install Dependencies

Install Node.js 22+

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
node -v

Install pnpm

sudo corepack enable
corepack prepare pnpm@latest --activate
pnpm -v

Install Homebrew (for skill dependencies)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Add to PATH:

echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew --version

Part 3: Firewall Setup

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

Part 4: Install Moltbot

Run the Installer

curl -fsSL https://clawd.bot/install.sh | bash

Fix PATH (if clawdbot command not found)

export PATH="$PATH:/home/nagdy/.npm-global/bin"
echo 'export PATH="$PATH:/home/nagdy/.npm-global/bin"' >> ~/.bashrc
source ~/.bashrc

Run Onboarding

clawdbot onboard --install-daemon

During onboarding:

  • Accept gateway defaults (local, port 18789, loopback)
  • Configure your LLM (we used GLM-4.7 / Z.AI)
  • Enable skills when prompted
  • Say yes to Homebrew
  • Choose "Hatch in TUI" to set up your bot's personality

Part 5: Connect Telegram

Create a Telegram Bot

  1. Open Telegram, message @BotFather
  2. Send /newbot
  3. Follow prompts, copy the Bot Token

First Message

Message your bot on Telegram. You'll get:

Clawdbot: access not configured.
Your Telegram user id: 5424063686
Pairing code: XXXXXXXX

Approve Pairing

clawdbot pairing approve telegram XXXXXXXX

Skip Pairing in Future (Optional)

Edit config to allowlist your user ID:

nano ~/.clawdbot/clawdbot.json

Find the channels.telegram section and add your ID:

"channels": {
  "telegram": {
    "enabled": true,
    "allowFrom": ["YOUR_TELEGRAM_USER_ID"],
    ...
  }
}

Restart:

clawdbot gateway restart

Part 6: Install GitHub Skill

Install GitHub CLI

brew install gh

Authenticate

gh auth login

Choose:

  • GitHub.com
  • HTTPS
  • Login with browser

Verify

gh auth status
clawdbot doctor | grep github

Should show ✓ ready.


Part 7: Check Skills Status

clawdbot doctor

Shows eligible skills and what's missing.

To unlock more bundled skills, install their dependencies:

# Example: unlock blogwatcher skill
brew install go

# Example: unlock gemini skill
brew install gemini-cli

# Check again
clawdbot doctor

Useful Commands

Command Purpose
clawdbot doctor Health check
clawdbot logs --follow View logs
clawdbot gateway restart Restart gateway
clawdbot dashboard --no-open Get tokenized Web UI URL
clawdbot pairing approve telegram CODE Approve Telegram user

Configuration File

Location: ~/.clawdbot/clawdbot.json

View it:

cat ~/.clawdbot/clawdbot.json

Workspace

Your bot's personality and skills live in:

~/clawd/
├── AGENTS.md
├── SOUL.md
├── IDENTITY.md
└── skills/

Resources


Credits

Guide by Ahmed Nagdy (NagdyWP)

Moltbot by Peter Steinberger (@steipete) and the community.

🦞

@MoSaeedHammad
Copy link

for brew, this works for me

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

and added this for certificates
sudo apt install ca-certificates
this is also recommended for DDoS Attacks:
sudo apt install fail2ban -y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment