Skip to content
________________________
V.1.0.0 // SECURE CONNECTION
Return_to_vault
[LOG: 2026-03-15]

VPS Self-Hosting Starter Pack

DevOpsInfrastructureBuilder

VPS Self-Hosting Starter Pack

Moved my projects off Vercel. Here's the actual setup, not the "just deploy to Railway" handwave. Real commands, real config, real costs.

Why Leave Vercel?

Vercel is great until you look at the bill. Or need custom server config. Or want to run multiple apps on one box. Or hit serverless cold starts on an API that needs to respond fast. $7/month gets you a real server with root access and no vendor lock-in.

The Stack

  • Hetzner CPX11 ($6.65/mo, 2 vCPU, 2GB RAM, 40GB SSD)
  • Caddy (auto-SSL, zero-config HTTPS, reverse proxy)
  • PM2 (keeps Node processes alive, auto-restart on crash)
  • Cloudflare DNS (free tier, fast propagation)

Total monthly cost: $6.65. Vercel Pro is $20/mo per member.

Setup

1. Create the Server

Spin up a Hetzner CPX11. Pick the closest region. Ubuntu 24.04. Add your SSH key during creation.

2. Basic Security

# Create deploy user
adduser deploy
usermod -aG sudo deploy

# Copy SSH key to deploy user
mkdir -p /home/deploy/.ssh
cp ~/.ssh/authorized_keys /home/deploy/.ssh/
chown -R deploy:deploy /home/deploy/.ssh

# Disable root SSH
sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
systemctl restart sshd

# Firewall
ufw allow OpenSSH
ufw allow 80
ufw allow 443
ufw enable

3. Install Node 22 + PM2

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g pm2
pm2 startup

4. Install Caddy

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

5. Caddy Config

The whole reverse proxy config. 3 lines. Auto-SSL included.

yoursite.com {
    reverse_proxy localhost:3000
}

That's it. Caddy handles HTTPS certificates automatically. No certbot. No cron jobs. No renewal scripts.

6. Deploy Script

#!/bin/bash
# deploy.sh - run locally
ssh deploy@your-server-ip << 'REMOTE'
  cd /home/deploy/your-app
  git pull origin main
  npm ci --production
  npm run build
  pm2 restart your-app
REMOTE
echo "Deployed."

One command: bash deploy.sh. That's your CI/CD.

Cost Comparison

ItemVercel ProSelf-Hosted
Hosting$20/mo$6.65/mo
SSLIncludedFree (Caddy)
Custom configLimitedFull root
Multiple appsExtra costSame server
Cold startsYesNo

When NOT to Self-Host

If you don't want to SSH into a server when something breaks at midnight, stay on Vercel. Seriously. Self-hosting means you're the ops team. Server goes down at 2 AM, that's your problem. No support ticket. No status page to blame. Just you and the terminal.

If that sounds fine, welcome to $6.65/month hosting.

Share

"End of transmission."

[CLOSE_LOG]