How much RAM does a Cloud VPS need to build and run Next.js smoothly?+
Running a compiled Next.js server typically uses only 150MB to 350MB of RAM, while `npm run build` needs around 1.5GB to 2.5GB of memory. A 2GB–4GB RAM VPS (with a 2GB swap file if on 2GB RAM) runs production builds and high traffic comfortably; 4GB+ RAM requires no swap tuning at all.
Is self-hosting Next.js on a Cloud VPS cheaper than serverless platforms?+
Yes, especially for content blogs, media sites, or apps with steady traffic and video/image uploads. A $4–$12/month VPS (or Oracle Cloud Always Free tier) includes generous bandwidth, persistent local storage for SQLite/uploads, zero cold starts, and predictable flat pricing with no surprise bandwidth overages.
Why put Nginx in front of Next.js instead of exposing port 3000 directly?+
Nginx handles TLS/HTTPS termination cleanly on ports 80 and 443, enforces HTTP-to-HTTPS 301 redirects, serves Gzip/Brotli compression, allows fine-grained upload size limits (like 100MB–500MB for media), protects Node.js from slow-client attacks, and makes hosting multiple domains on one server effortless.
Why is my site unreachable on port 80 even after starting Nginx on Oracle Cloud or AWS?+
Cloud VPS providers enforce two firewall layers: the cloud Security List / Security Group in your web console AND the OS firewall inside Ubuntu (UFW or iptables). On Oracle Cloud Ubuntu images specifically, default iptables rules include a REJECT rule that blocks ports 80 and 443 until you insert ACCEPT rules above the REJECT line and save them.
Does Let's Encrypt SSL expire, and how do I automate renewal?+
Let's Encrypt certificates are valid for 90 days. When installed via Certbot (`python3-certbot-nginx`), Ubuntu automatically enables `certbot.timer` in systemd, which checks twice daily and silently renews certificates 30 days before expiry with zero downtime.
How do I keep Next.js running 24/7 after closing my SSH terminal or rebooting the server?+
Use PM2 (`pm2 start`, `pm2 save`, and `pm2 startup systemd`). PM2 runs Next.js as a background daemon, restarts it automatically if it ever crashes or hits a memory cap, and restores your app automatically after server reboots.