BattlecatAI
HomeBrowsePathsToolsLevel UpRewardsBookmarksSearchSubmit

Battlecat AI — Built on the AI Maturity Framework

The Real Way to Deploy AI Assistants: Why Your VPS is Under Attack in 12 Seconds
L1 InstructorPracticeadvanced5 min read

The Real Way to Deploy AI Assistants: Why Your VPS is Under Attack in 12 Seconds

Your fresh Linux VPS starts getting SSH scanned within 12 seconds of going live. Here's how to properly secure and deploy AI assistants like OpenClaw without becoming another statistic in the bot farm wars.

AI assistant setupVPS deploymentLinux server administrationsecurity hardeningOpenClawClaude

Your shiny new VPS just came online. Congratulations — you now have exactly 12 seconds before the bots find you.

This isn't hyperbole. The moment your server gets an IP address, automated scanners begin probing for weak SSH passwords, default credentials, and unpatched services. Installing your AI assistant first and securing it later is like leaving your front door wide open while you're at the hardware store buying locks.

Why This Matters: The Reality of VPS Deployment

The appeal of running your own AI assistant like OpenClaw on a VPS is obvious. You get complete control, better privacy, and the satisfaction of actually owning your infrastructure. But here's what nobody tells you: modern servers exist in a hostile environment where security isn't optional — it's survival.

Every public IP address gets constantly hammered by:

  • SSH brute force attempts
  • Port scans looking for vulnerable services
  • Bots probing for default credentials
  • Automated exploit attempts against common vulnerabilities

The internet is not a friendly place for unprotected servers. Security hardening isn't paranoia — it's basic hygiene.

Thinking you'll just "add security later" is like wearing a blindfold in a knife fight. You need to lock down your server before installing anything else.


The Foundation: Hardening Before Installing

Step 1: Immediate System Updates

Before you even think about installing your AI assistant, update everything:

sudo apt update && sudo apt upgrade -y

These aren't optional nice-to-haves. System updates patch known vulnerabilities that attackers actively exploit. Running outdated packages is like advertising "please hack me" in neon letters.

Step 2: SSH Hardening (The Critical Step)

SSH is your lifeline to the server, but it's also the primary attack vector. Here's the harsh truth: keeping SSH on the default port 22 with password authentication is security malpractice.

Key SSH hardening steps:

  • Change the default port from 22 to something non-standard (like 2222)
  • Disable password authentication entirely
  • Use SSH keys exclusively
  • Configure automatic fail2ban to block brute force attempts

Moving SSH off port 22 won't stop determined attackers, but it eliminates 99% of automated noise. It's like not leaving your car keys on the dashboard.

Step 3: Firewall Configuration

Ubuntu's UFW (Uncomplicated Firewall) makes this straightforward:

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 2222/tcp  # Your custom SSH port
sudo ufw enable

The principle is simple: block everything by default, then explicitly allow only what you need. Every open port is a potential attack surface.


The VPN Mesh Approach: Next-Level Security

Here's where most tutorials stop, but modern security goes further. Instead of exposing your AI assistant to the public internet, create a private VPN mesh using Tailscale.

Why VPN Mesh Networks Matter

Traditional security creates a "hard shell, soft interior" — once someone breaks through your firewall, they have access to everything. VPN mesh networks flip this model:

  • No public web ports exposed
  • SSH only accessible through the VPN
  • Zero-trust networking by default
  • Encrypted traffic between all nodes

Setting Up Tailscale Integration

  1. Install Tailscale on your VPS and client devices
  2. Restrict SSH access to only work through Tailscale IPs
  3. Disable IPv6 in UFW to eliminate attack surface
  4. Configure kernel networking parameters for VPN optimization

This creates a setup where your server is essentially invisible to the public internet while remaining fully accessible to you.

With a proper VPN mesh, your AI assistant becomes accessible from anywhere while remaining completely hidden from attackers.


Installing OpenClaw: The Right Way

Preparation and Dependencies

Now that your server is hardened, you can actually install your AI assistant. But even this requires careful planning:

sudo apt install git nodejs npm python3 python3-pip

Never trust NPM dependencies blindly. Yes, modern development means trusting hundreds of dependencies, but at minimum:

  • Verify the official repository isn't compromised
  • Check for obvious red flags in the dependency tree
  • Use npm audit to identify known vulnerabilities

Directory Structure and Permissions

Don't dump production applications in your home directory like an amateur:

sudo mkdir -p /opt/openclaw
sudo chown $USER:$USER /opt/openclaw
cd /opt/openclaw
git clone [official-openclaw-repo]

Proper directory permissions prevent privilege escalation attacks and make system administration cleaner.

SystemD Service Configuration

Yes, SystemD is controversial among Linux purists, but it's the reality of modern Linux distributions. Configure your AI assistant as a proper system service:

  • Automatic startup on boot
  • Process monitoring and restart on failure
  • Proper logging integration
  • Resource limits to prevent runaway processes

Running production applications as SystemD services isn't complexity for its own sake — it's operational reliability.


The Security Audit Reality Check

You've hardened SSH, configured firewalls, set up VPN networking, and installed your AI assistant. You're done with security, right?

Wrong.

Security is an ongoing process, not a one-time checklist:

  • Enable automatic security updates for critical packages
  • Configure comprehensive logging for security monitoring
  • Run application security audits if your AI assistant provides them
  • Monitor resource usage for signs of compromise
  • Keep dependencies updated regularly

Monitoring and Maintenance

A properly secured VPS running an AI assistant should achieve:

  • 98%+ uptime (accounting for planned maintenance)
  • No successful unauthorized access attempts
  • Minimal resource overhead from security tools
  • Clean audit logs with no suspicious activity

The Bottom Line

Deploying an AI assistant on a VPS isn't just about getting the software running — it's about creating a secure, maintainable system that won't become part of a botnet. The 12-second attack window is real, and proper security hardening before installation is non-negotiable. With SSH hardening, firewall configuration, VPN mesh networking, and ongoing security monitoring, you can run your own AI infrastructure without becoming another casualty in the bot wars. The complexity is worth it for the control, privacy, and learning experience of managing your own AI systems.

Try This Now

  • 1Set up a fresh Ubuntu VPS with immediate system updates via apt update && apt upgrade
  • 2Configure SSH hardening with key-only authentication on a non-standard port using UFW firewall rules
  • 3Install and configure Tailscale VPN mesh networking for zero-exposure server access
  • 4Deploy OpenClaw as a SystemD service with proper directory permissions in /opt/
  • 5Enable automatic security updates and configure comprehensive logging for ongoing monitoring

How many Orkos does this deserve?

Rate this tutorial

Sources (1)

  • https://www.tiktok.com/t/ZP8xNAeJ1
← All L1 tutorialsBrowse all →