Deploy Next.js to VPS: Step-by-Step Beginner Guide
Deploy a production-ready Next.js application to any Ubuntu VPS using DeployWise — covers SSH setup, PM2 process management, Nginx reverse proxy and free SSL certificates. No DevOps experience required.
What you need
Why deploy Next.js to a VPS?
Vercel and similar platforms are excellent for prototypes and small projects. But as your app grows, costs can skyrocket — Vercel charges $0.15/GB for bandwidth above 100 GB, and team plans start at $20/month per member.
A $5/month VPS from Hetzner or DigitalOcean can host multiple production Next.js apps with no traffic limits, full SSH access, and complete control over your environment. The tradeoff used to be complexity — but that's what DeployWise solves.
1Set up your VPS
Start with a fresh Ubuntu 22.04 LTS droplet/instance. Make sure SSH is accessible on port 22 (or a custom port). You'll need either a root password or an SSH private key.
Recommended minimum specs for a single Next.js app:
| Spec | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 1 GB | 2 GB |
| Storage | 20 GB SSD | 40 GB SSD |
| Monthly cost | ~$5/mo | ~$10/mo |
2Add your server to DeployWise
Open DeployWise dashboard and sign in with GitHub. Then navigate to Servers → Add Server and fill in:
Click Test Connection. DeployWise will SSH into your server to verify connectivity. If the test passes, save the server.
3Create your project
Go to Projects → New Project. Connect your GitHub account if you haven't already, then configure:
4Deploy
Click Deploy Now. DeployWise will execute the following steps on your server automatically:
The entire process typically takes 30–90 seconds. You can watch every step live in the deployment log panel.
What happens after deployment
Your app is now:
Future deploys are one click away. If something breaks, roll back to any previous commit from the deployment history.
Common issues
The Next.js build process can require 1–1.5 GB RAM. If your VPS has only 1 GB, add a 1 GB swap file: sudo fallocate -l 1G /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile
Another PM2 process may be occupying the port. Check with: pm2 list — and stop conflicting processes, or change your project's port.
Ensure your domain's A record points to your VPS IP and that port 80 is open in your firewall (ufw allow 80).
Ready to deploy?
Sign in with GitHub, add your VPS, and have your Next.js app live in minutes — for free.
Open DeployWise DashboardFrequently Asked Questions
How long does it take to deploy Next.js to a VPS?+
With DeployWise, about 5 minutes. Manually, expect 30-60 minutes for first-time setup including SSH, Node.js, PM2, Nginx, and SSL.
Do I need DevOps experience to deploy to VPS?+
No. This guide walks you through every step. With DeployWise, the entire process is automated — you just connect your GitHub repo and server.
Which VPS provider is best for Next.js?+
Hetzner offers the best price-to-performance ratio. DigitalOcean has the best documentation. Hostinger is the cheapest starting at $4/month. All work great with Next.js.
Can I run multiple Next.js apps on one VPS?+
Yes! A $10/month VPS with 2GB RAM can comfortably run 3-5 Next.js apps using PM2 process management.