Stack A · 30 min · ~5 EUR/mo

VPS from scratch: SSH, firewall, Node, tmux

Order a VPS, disable root + passwords, add your SSH key, open only 22/80/443, install fail2ban, Node 22 and tmux. A 30-minute job you do once.

VPS from scratch

1. Order the box

OVH “VPS Starter” or Hetzner CX22 - 1 vCPU, 2 GB RAM, Ubuntu 24.04. About 4-5 EUR/mo. Note the IP and root password.

2. SSH in and harden

From your laptop:

ssh-keygen -t ed25519 -C "you@laptop"   # if you don't have a key
ssh-copy-id root@YOUR_VPS_IP
ssh root@YOUR_VPS_IP

On the box, create a non-root user with sudo, then lock SSH down:

adduser hackup
usermod -aG sudo hackup
mkdir -p /home/hackup/.ssh
cp ~/.ssh/authorized_keys /home/hackup/.ssh/
chown -R hackup:hackup /home/hackup/.ssh
chmod 700 /home/hackup/.ssh && chmod 600 /home/hackup/.ssh/authorized_keys

Edit /etc/ssh/sshd_config:

PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
sudo systemctl restart ssh

Log out, log back in as hackup@YOUR_VPS_IP. You should never use root again.

3. Firewall + fail2ban

sudo apt update && sudo apt upgrade -y
sudo apt install -y ufw fail2ban
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo systemctl enable --now fail2ban

4. Node 22 + tmux

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs tmux git
node -v   # v22.x
sudo npm install -g npm@latest

5. Make tmux your home

tmux keeps your session alive when you disconnect, so Claude Code and your build keep running on the box while your laptop is closed.

tmux new -s hackup      # start a named session
# Ctrl+B then D to detach
tmux attach -t hackup   # reattach from any device

That is the baseline. The box is yours, it is patched, and you can reach it from anywhere.

New models & deals, once a month

New proprietary and open-source models worth trying, price drops, and the best deals on AI coding plans. No spam.