skills/setup-vps/SKILL.md
Auto-harden a Linux VPS for secure betaclaw deployment
npx skillsauth add Rawknee-69/Beta-Claw setup-vpsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are the VPS deployment and security hardening assistant. When invoked on a Linux VPS, systematically secure the server and configure betaclaw for production deployment.
/etc/os-release.ss -tlnp to understand current exposure.apt-get update && apt-get upgrade -y # Debian/Ubuntu
# or
dnf update -y # RHEL/Fedora
Install essential tools: curl, wget, git, unzip, jq.
betaclaw user: useradd -m -s /bin/bash betaclawbetaclaw user.betaclaw user (principle of least privilege).apt-get install -y ufw
ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp comment 'SSH'
ufw allow 443/tcp comment 'HTTPS'
# Add any channel-specific ports (e.g., webhook port)
ufw --force enable
Ask the user if any additional ports need to be opened (e.g., HTTP webhook on custom port).
Edit /etc/ssh/sshd_config:
PermitRootLogin noPasswordAuthentication no (key-only auth)PubkeyAuthentication yesMaxAuthTries 3X11Forwarding noAllowUsers betaclaw (restrict to the betaclaw user plus any admin user)Restart sshd: systemctl restart sshd
CRITICAL: Before restarting sshd, verify the user can log in with key auth in a separate session to avoid lockout.
apt-get install -y fail2ban
Create /etc/fail2ban/jail.local:
[sshd]
enabled = true
port = ssh
maxretry = 5
bantime = 3600
findtime = 600
[betaclaw-webhook]
enabled = true
port = 443
maxretry = 10
bantime = 1800
findtime = 300
Start and enable: systemctl enable --now fail2ban
curl -s https://install.crowdsec.net | bash
cscli collections install crowdsecurity/linux
cscli collections install crowdsecurity/sshd
systemctl enable --now crowdsec
apt-get install -y unattended-upgrades
dpkg-reconfigure -plow unattended-upgrades
Configure to auto-install security updates only (not feature updates).
curl -fsSL https://get.docker.com | shbetaclaw user to docker group: usermod -aG docker betaclaw/etc/docker/daemon.json):
{
"userns-remap": "default",
"no-new-privileges": true,
"log-driver": "json-file",
"log-opts": { "max-size": "10m", "max-file": "3" }
}
systemctl restart dockercurl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
Verify: node --version (must be >= 20.0.0).
/home/betaclaw/betaclaw/.cd /home/betaclaw/betaclaw && npm install --productionnpm run buildchown -R betaclaw:betaclaw /home/betaclaw/Create /etc/systemd/system/betaclaw.service:
[Unit]
Description=betaclaw AI Agent Runtime
After=network.target
[Service]
Type=simple
User=betaclaw
Group=betaclaw
WorkingDirectory=/home/betaclaw/betaclaw
ExecStart=/usr/bin/node dist/cli/index.js start --foreground
Restart=on-failure
RestartSec=5
StandardOutput=append:/home/betaclaw/betaclaw/.beta/logs/app.log
StandardError=append:/home/betaclaw/betaclaw/.beta/logs/app.log
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable --now betaclaw
If the user wants strict egress:
betaclaw user limiting outbound connections to allowlisted hosts only (AI provider APIs, search APIs).Run a full diagnostic:
ufw status verbose — verify firewall rulesfail2ban-client status — verify jailssystemctl status betaclaw — verify service is runningdocker info — verify Docker (if applicable)betaclaw doctor to verify internal healthReport all results. Provide the user with:
journalctl -u betaclaw -fsystemctl restart betaclawdevelopment
Search the web and summarize results
development
Send messages via Telegram Bot API
data-ai
Show system health, active models, channels, and skills
tools
Full betaclaw installation and onboarding wizard