Pricing
Tutorials May 16, 2026 · 8 min read

Deploy Next.js on VPS with Nginx + PM2

Build to production — every command included.

AT
Arjun T. · 8 min read
Back to Blog Code on screen

This tutorial walks through every step with commands you can copy-paste. Designed for developers comfortable with a terminal who want to deploy on a Linux VPS.

Before You Start

The Deployment Process

  1. SSH in and update packages: apt update && apt upgrade -y
  2. Install your runtime (Node.js, Python, or Docker)
  3. Upload your app via Git clone or rsync
  4. Configure environment variables
  5. Set up Nginx reverse proxy
  6. Enable SSL with Certbot: certbot --nginx -d yourdomain.com
  7. Configure process manager (PM2 for Node, systemd for Python)

Post-Deployment Checklist

💡 Troubleshooting: If your app isn't accessible: 1) Is the process running? 2) Is Nginx configured? (nginx -t) 3) Is the firewall allowing traffic? (ufw status) 4) Is DNS propagated? (dig yourdomain.com)
Next.jsVPSNginxPM2

Ready to put this into practice?

VoloWeb hosting starts at ₹69/mo — NVMe SSD, LiteSpeed, free SSL, 24/7 Indian support.

Get Started — ₹69/mo