Your Personal AI Assistant on a VPS — The Actual Commands We Used
By Ahmed Nagdy | NagdyWP
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
ssh root@YOUR_SERVER_IPapt update && apt upgrade -yapt install -y build-essential curl wget git unzip htop tmux ufwadduser nagdy
usermod -aG sudo nagdy
su - nagdysudo 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/fstabVerify:
free -hcurl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
node -vsudo corepack enable
corepack prepare pnpm@latest --activate
pnpm -v/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 --versionsudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw enable
sudo ufw statuscurl -fsSL https://clawd.bot/install.sh | bashexport PATH="$PATH:/home/nagdy/.npm-global/bin"
echo 'export PATH="$PATH:/home/nagdy/.npm-global/bin"' >> ~/.bashrc
source ~/.bashrcclawdbot onboard --install-daemonDuring 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
- Open Telegram, message
@BotFather - Send
/newbot - Follow prompts, copy the Bot Token
Message your bot on Telegram. You'll get:
Clawdbot: access not configured.
Your Telegram user id: 5424063686
Pairing code: XXXXXXXX
clawdbot pairing approve telegram XXXXXXXXEdit config to allowlist your user ID:
nano ~/.clawdbot/clawdbot.jsonFind the channels.telegram section and add your ID:
"channels": {
"telegram": {
"enabled": true,
"allowFrom": ["YOUR_TELEGRAM_USER_ID"],
...
}
}Restart:
clawdbot gateway restartbrew install ghgh auth loginChoose:
- GitHub.com
- HTTPS
- Login with browser
gh auth status
clawdbot doctor | grep githubShould show ✓ ready.
clawdbot doctorShows 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| 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 |
Location: ~/.clawdbot/clawdbot.json
View it:
cat ~/.clawdbot/clawdbot.jsonYour bot's personality and skills live in:
~/clawd/
├── AGENTS.md
├── SOUL.md
├── IDENTITY.md
└── skills/
Guide by Ahmed Nagdy (NagdyWP)
Moltbot by Peter Steinberger (@steipete) and the community.
🦞
for brew, this works for me
and added this for certificates
sudo apt install ca-certificatesthis is also recommended for DDoS Attacks:
sudo apt install fail2ban -y