Inicio / Blueprints / Next.js 15 Standalone + PM2
JavaScript & Full-Stack

Self-Host Next.js 15 on Ubuntu LTS with PM2 Cluster & Caddy

Production blueprint for hosting Next.js 15 standalone server on bare-metal Ubuntu with PM2 cluster mode, Caddy automatic HTTPS, and zero-downtime releases.

Recommended Cloud Specification Hetzner CPX21 (3 vCPU, 4GB RAM) or DigitalOcean 4GB ($12-$15/mo)
Node.js 22 LTS PM2 Process Manager (Cluster) Caddy Web Server Redis / Postgres

Architectural Highlights

Unlimited bandwidth and zero serverless function timeout limits.
PM2 cluster mode running one worker per CPU core with automatic self-healing.
Caddy automatic SSL certificates and reverse proxy with HTTP/3 support.
Complete root sovereignty with 100% data privacy.
Environment Template (.env)
NODE_ENV=production
PORT=3000
NEXT_TELEMETRY_DISABLED=1
HOSTNAME=0.0.0.0
Deploy Script (deploy.sh)
npm ci --production=false
npm run build
pm2 reload ecosystem.config.js --update-env

Blueprint FAQ

How does PM2 reload without dropping user connections?

Serverfy triggers `pm2 reload`, which performs rolling process swaps: starting new worker processes and validating health before gracefully terminating old ones.

Deploy This Blueprint in Under 3 Minutes

Connect your VPS, select this blueprint, and deploy with automated SSL, systemd daemons, and zero downtime.