
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.
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.
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:
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.
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.
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:
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.
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.
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.
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:
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.
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:
npm audit to identify known vulnerabilitiesDon'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.
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:
Running production applications as SystemD services isn't complexity for its own sake — it's operational reliability.
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:
A properly secured VPS running an AI assistant should achieve:
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.
Rate this tutorial