How to Host a Next.js App: Shared vs VPS vs Serverless
Next.js has become the default React framework for production apps. Server-side rendering, API routes, middleware, image optimization. It does a lot. But all those features create a specific hosting requirement that traditional shared hosting simply cannot meet.
The problem is straightforward. Next.js needs a Node.js runtime. Shared hosting gives you PHP and Apache. That mismatch means you need to look beyond the usual $2.99/month plans. Your actual options break down into three categories: managed cloud platforms, unmanaged VPS, and serverless/PaaS providers.
Why Shared Hosting Does Not Work for Next.js
Traditional shared hosting runs on Apache or LiteSpeed with PHP. Hosts like Hostinger, SiteGround, and A2 Hosting are designed for WordPress, HTML sites, and PHP applications. You get a cPanel, a MySQL database, and maybe some SSH access.
Next.js requires a persistent Node.js process. It needs to run next start (or a custom server) and stay alive to handle SSR requests. Shared hosting kills long-running processes. Even if a host offers Node.js support, it is usually limited to static file serving or restricted environments that break Next.js features like API routes and middleware.
The only exception: if you export your Next.js app as a fully static site (using output: 'export'), you can drop those HTML files on any hosting provider. But then you lose SSR, API routes, server components, and most of what makes Next.js worth using.
Option 1: Managed Cloud Hosting (Easiest)
Managed cloud platforms handle the server setup, Node.js environment, SSL, and deployments for you. You push code. They do the rest.
Cloudways
Cloudways offers managed cloud servers on top of DigitalOcean, Vultr, Linode, AWS, and Google Cloud. Their entry-level plan starts at $14/month and gives you 1 vCPU, 1 GB RAM, and 25 GB SSD storage with 1 TB bandwidth.
The main advantage is the managed layer. Cloudways handles server-level caching (Varnish, Redis, Memcached), automated backups, security patching, and 24/7 monitoring. You get SSH access and can install Node.js, PM2, or any runtime you need. The downside: Cloudways is built primarily for PHP apps, so the Node.js setup requires manual SSH configuration.
| Cloudways Plan | Price | CPU | RAM | Storage | Bandwidth |
|---|---|---|---|---|---|
| DO Basic Micro | $14/mo | 1 vCPU | 1 GB | 25 GB NVMe | 1 TB |
| DO Basic Small | $28/mo | 1 vCPU | 2 GB | 50 GB NVMe | 2 TB |
| DO Basic Medium | $54/mo | 2 vCPU | 4 GB | 80 GB NVMe | 4 TB |
Kinsta
Kinsta runs on Google Cloud Platform and launched a dedicated Application Hosting service alongside their WordPress hosting. Their WordPress plans start at $29.17/month (billed yearly), but for Next.js you would use Kinsta Application Hosting, which supports Node.js natively with automatic builds from GitHub.
Kinsta's Application Hosting uses Buildpacks, supports environment variables, custom domains, and gives you automatic HTTPS. For a Next.js app, this is arguably the smoothest managed experience because the platform is designed for exactly this use case. Pricing is usage-based, starting from their free tier for hobby projects.
Option 2: Unmanaged VPS (Cheapest)
An unmanaged VPS gives you a blank Linux server. You install Node.js, configure Nginx as a reverse proxy, set up PM2 for process management, handle SSL with Let's Encrypt, and manage your own updates. Total control, lowest price, most work.
DigitalOcean
DigitalOcean is the most popular choice for developers deploying Node.js applications. Their cheapest usable droplet for a Next.js app costs $6/month (1 vCPU, 1 GB RAM, 25 GB NVMe SSD, 1 TB bandwidth). For apps with moderate traffic, the $12/month plan with 2 GB RAM is a better starting point.
DigitalOcean also offers App Platform, a PaaS product that auto-deploys from Git. Pricing starts at $5/month for a static site or $12/month for a basic service with 1 shared vCPU and 1 GB RAM. It supports Next.js directly and handles SSL, CDN, and scaling.
| DigitalOcean Plan | Price | CPU | RAM | Storage | Bandwidth |
|---|---|---|---|---|---|
| Basic Regular 1 GiB | $6/mo | 1 vCPU | 1 GB | 25 GB NVMe | 1 TB |
| Basic Regular 2 GiB | $12/mo | 1 vCPU | 2 GB | 50 GB NVMe | 2 TB |
| Basic Regular 4 GiB | $24/mo | 2 vCPU | 4 GB | 80 GB NVMe | 4 TB |
| App Shared 1vCPU/1 GiB | $10/mo | 1 shared vCPU | 1 GB | N/A | 100 GB |
Vultr
Vultr competes directly with DigitalOcean and often wins on raw price. Their cheapest cloud compute instance is $2.50/month (1 vCPU, 512 MB RAM, 10 GB SSD). For a Next.js app, the $5/month plan (1 vCPU, 1 GB RAM, 25 GB SSD) is the practical minimum. Vultr also has High Frequency plans starting at $6/month with NVMe storage and faster CPUs for better SSR performance.
| Vultr Plan | Price | CPU | RAM | Storage | Bandwidth |
|---|---|---|---|---|---|
| CC Regular 1vCPU/1 GB | $5/mo | 1 vCPU | 1 GB | 25 GB SSD | 1 TB |
| CC High Freq 1vCPU/1 GB | $6/mo | 1 vCPU | 1 GB | 32 GB NVMe | 1 TB |
| CC Regular 1vCPU/2 GB | $10/mo | 1 vCPU | 2 GB | 55 GB SSD | 2 TB |
| CC High Freq 1vCPU/2 GB | $12/mo | 1 vCPU | 2 GB | 64 GB NVMe | 2 TB |
Linode (Akamai)
Linode, now part of Akamai, starts at $5/month for a Nanode with 1 GB RAM, 25 GB SSD, and 1 TB bandwidth. The $12/month Shared 2 GB plan gives your Next.js app more breathing room. Linode's advantage over competitors is consistent performance and a slightly simpler dashboard.
Option 3: Serverless and PaaS (Most Scalable)
Platform-as-a-Service providers give you a middle ground. You push your code, they build and deploy it. No server management, but you still have control over your application.
Railway
Railway is built for exactly this use case. Their free tier includes 0.5 GB RAM and up to 1 vCPU during the trial period. The Hobby plan at $5/month gives you access to up to 48 vCPUs and 48 GB RAM with usage-based pricing, meaning you only pay for what your app actually consumes. The Pro plan at $20/month adds team features and scales up to 1,000 vCPUs.
Railway supports Next.js out of the box. Connect your GitHub repo, and it automatically detects the framework, runs the build, and deploys. Environment variables, custom domains, and automatic HTTPS are all included. The billing model works well for apps with variable traffic since you pay per execution time rather than for a server that sits idle.
Vercel (The Official Option)
Vercel is built by the same team behind Next.js. The Hobby tier is free for personal projects, and the Pro plan starts at $20/month per team member. Since Vercel and Next.js share a development team, new framework features often work best on Vercel first. Edge middleware, ISR, and server actions are optimized for the Vercel platform.
The catch: Vercel can get expensive at scale. Bandwidth overages, function invocations, and build minutes all have costs that add up. For a production app with consistent traffic, a $12/month DigitalOcean droplet might handle the same load that costs $50+ on Vercel.
Cost Comparison: Real Numbers
Here is what you would actually pay for each approach, using plans suitable for a Next.js app with moderate traffic (roughly 50,000 monthly visitors).
| Hosting Approach | Provider | Monthly Cost | RAM | You Manage |
|---|---|---|---|---|
| Unmanaged VPS | Vultr (High Freq) | $12/mo | 2 GB | Everything |
| Unmanaged VPS | DigitalOcean | $12/mo | 2 GB | Everything |
| Unmanaged VPS | Linode | $12/mo | 2 GB | Everything |
| PaaS | Railway Hobby | $5 + usage | Up to 48 GB | App only |
| Managed Cloud | Cloudways (DO) | $14/mo | 1 GB | App only |
| Managed Cloud | Cloudways (DO Small) | $28/mo | 2 GB | App only |
| Serverless | Vercel Pro | $20/mo + usage | Auto-scaled | Nothing |
Which Option Should You Choose?
Choose a VPS if:
- You are comfortable with Linux, Nginx, and PM2
- You want the lowest monthly cost at $5-12/month
- Your traffic is predictable and consistent
- You need full control over the server environment
Choose managed cloud (Cloudways) if:
- You want someone else handling server security and updates
- You are willing to pay a premium ($14-28/month) for convenience
- You also run PHP apps or WordPress sites on the same server
Choose PaaS/Serverless if:
- You want zero server management
- Your traffic is spiky or unpredictable
- You prioritize deployment speed over cost optimization
- You are using advanced Next.js features like edge middleware or ISR
Deployment Tips for Next.js
Regardless of which hosting you choose, keep these points in mind:
- Standalone output mode. Set
output: 'standalone'in yournext.config.js. This creates a self-contained build that does not need the entirenode_modulesdirectory, reducing your deployment size by 80% or more. - Environment variables. Use
.env.productionlocally but set variables through your hosting provider's dashboard for production. Never commit secrets to Git. - PM2 for VPS. If you are running on a VPS, use PM2 to keep your Next.js process alive and restart it on crashes. A basic
ecosystem.config.jsfile is all you need. - Nginx reverse proxy. On a VPS, put Nginx in front of your Next.js app to handle SSL termination, static file serving, and request buffering. This improves performance significantly compared to exposing Node.js directly.
- Image optimization. Next.js's
<Image>component requires the Sharp library in production. On a VPS, install it globally or as a project dependency. PaaS providers usually handle this automatically.
Bottom Line
Shared hosting is out. That is the only absolute rule for Next.js. Everything else depends on your budget and technical comfort level. A $6/month DigitalOcean droplet or $5/month Vultr instance will run a Next.js app just fine if you know your way around a terminal. Railway at $5/month plus usage is the fastest path from code to production. And Cloudways at $14/month sits in the middle, giving you managed convenience without the markup of a pure serverless platform.
For most developers building a production Next.js app, my recommendation is to start with Railway or a DigitalOcean App Platform. They remove the DevOps overhead while keeping costs reasonable. If your app grows and traffic becomes predictable, switch to a VPS for the best price-to-performance ratio.