Deploying Next.js

Build, run with PM2, HTTPS with Nginx + Certbot

Use the Next.js / frontend use case (2 vCPU / 4 GB+).

npm ci && npm run build
npm install -g pm2 && pm2 start npm --name site -- start -- -p 3000 && pm2 save && pm2 startup
apt install -y nginx certbot python3-certbot-nginx && certbot --nginx -d example.com

Proxy location / to http://127.0.0.1:3000.

Updated