Learning objectives
After reading this article you will be able to:
- Understand how the Next.js rendering mode changes the cost
- Compare the billing models of serverless platforms, a VPS and a static export
- Estimate your app's monthly bill from traffic and requests
On this page
- What determines the cost of hosting a Next.js app?
- How much does a static export cost?
- How much do serverless platforms cost?
- How much does it cost to run Next.js on your own server?
- How do I estimate my app's bill?
- What are the hidden costs?
- How do I cut costs without losing features?
- How to do this on Square Cloud
- FAQs
Next.js is a framework, not a type of hosting. The same project can become a folder of static files, an always-on Node.js server or a set of functions that run on every request. Each shape has a different billing model, which is why answers to "how much does it cost" range from zero to hundreds of dollars.
Third-party prices change often, so this guide shows how each model bills. The numbers in this article are hypothetical, chosen to make the math easy. They are not any provider's prices; real values live on the official pricing pages. Check those pages before you decide.
What determines the cost of hosting a Next.js app?#
Four factors explain almost the whole bill:
- The rendering mode. Pages generated at build time (static) cost almost nothing to serve. Pages rendered on every request (SSR), Server Actions, API routes and ISR need compute. If the difference is still fuzzy, see SSR vs SSG vs static.
- Traffic. How many GB go out each month. It depends on the number of visits and the weight of each page.
- Requests and CPU time. Serverless platforms bill per invocation, per CPU time and per provisioned memory.
- Extras: the domain (yearly), team seats, build minutes, database and email.
The Next.js documentation lists four ways to deploy: a Node.js server and a Docker container (all features), a static export (limited features) and adapters for specific platforms. That choice weighs more on the cost than the provider does.
How much does a static export cost?#
With output: 'export' in next.config, next build produces an out folder with HTML, CSS and JavaScript. Any static file server can serve it, and the cost drops to near zero:
- GitHub Pages: no cost, with limits on site size and monthly bandwidth published in the docs. It is not meant for online stores or sites whose main purpose is commercial transactions.
- Cloudflare Workers with static assets: billing treats requests to static assets separately from requests that run code; check the pricing page for how each one is billed.
The trade-off is features. A static export does not support cookies, redirects, rewrites and headers from next.config, proxy (formerly middleware), ISR, Server Actions, dynamic routes without generateStaticParams() or image optimization with the default loader. If your app is a blog, a landing page or documentation, you will rarely miss them. See what a static site is.
How much do serverless platforms cost?#
When the app needs a server, platforms that turn routes into functions charge a monthly fee with an included quota, plus usage overage. They follow three main models:
| Model | Example | How it bills | What to watch |
|---|---|---|---|
| Seat with quota | Vercel | Monthly fee per developer, with a transfer and request quota and a usage credit | Overage per GB and per million requests or invocations; the no-cost personal plan is for non-commercial use only |
| Credits | Netlify | Monthly fee with a credit allowance, spent on bandwidth, compute, deploys and requests | The site pauses when credits run out, unless you buy more |
| Requests and CPU | Cloudflare Workers | Low monthly fee with a quota of requests and CPU milliseconds | Overage per million requests and per million CPU ms |
On Netlify, each GB of bandwidth, each GB-hour of compute, each production deploy and each batch of requests uses a fixed number of credits, published in the billing FAQ. When a paid plan runs out of credits, every site on the team pauses until the next cycle, unless you buy credit packs or turn on auto recharge.
On Vercel, new teams get a default on-demand budget, with notifications as they approach it. Pausing projects automatically when the budget is reached is optional.
How much does it cost to run Next.js on your own server?#
With next start or the standalone output, Next.js is a regular Node.js process. It runs on any VPS, and you pay for the machine, not for usage. Providers sell VPS plans by size, at a fixed monthly price, and the smallest ones tend to cost a few dollars. When you compare plans (on DigitalOcean's pricing page, for example), look at three numbers:
- RAM: it decides whether the app and the build fit on the machine.
- Included transfer: how many GB can go out each month at no extra cost.
- Overage price: what each GB beyond the quota costs.
How much memory should you pick? In one test, a minimal Next.js app running next start used around a hundred MB of memory after 200 requests. A real app, with dozens of pages, UI libraries and image optimization, goes past that. next build also tends to use much more memory than the running app, and a build killed for lack of RAM is common on small servers. Build in CI or on your machine and upload the result. To measure your own case, see how to size RAM and CPU.
The cost that does not show up on the invoice is your time: system updates, reverse proxy, TLS certificate, process restarts and monitoring are on you. The full comparison is in how much a VPS costs.
How do I estimate my app's bill?#
Do the math with your own traffic. Hypothetical example: a commercial site with 100,000 page views per month, each transferring 1.5 MB (HTML, JavaScript, CSS and images) and making 30 requests.
traffic = 100,000 × 1.5 MB = 150,000 MB ≈ 150 GB per month
requests = 100,000 × 30 = 3,000,000 per monthWith those numbers and hypothetical prices, each model works out like this:
- Seat with quota: if the no-cost personal plan is for non-commercial use only, it does not work, because the site is commercial. Assuming a plan of $10 per developer with 200 GB and 5 million requests included, 150 GB and 3 million requests fit the quota, and a team of two pays $20, plus any function usage above the included credit.
- Credits: assuming 10 credits per GB of bandwidth and 1 per 10,000 requests, bandwidth alone uses 150 × 10 = 1,500 credits, and requests add 300 × 1 = 300. That is 1,800 credits before counting deploys and compute. If the plan includes 1,000, you would need to buy extra credits.
- Requests and CPU: if requests to static assets stay out of the CPU math, only renders count. If 100,000 renders a month use 20 ms of CPU each (measure your app), that is 2 million ms; compare it with the plan's CPU ms quota.
- VPS: assuming a $10-a-month machine with 1 GB of RAM and 500 GB of transfer included, 150 GB fits easily, as long as 1 GB of RAM can handle the app. Add your maintenance time.
The average page weight changes everything. If images are optimized and the page drops to 500 KB, traffic falls to about 50 GB and the bill shrinks on almost every model.
What are the hidden costs?#
- Per-seat pricing. On plans billed per seat, such as Vercel Pro, each developer who deploys adds a monthly fee.
- Bots and attacks. Crawlers and automated traffic use bandwidth and invocations just like real visitors.
- Revalidation and functions. ISR, API routes and Server Actions become invocations and CPU time, even on pages that look static.
- Build minutes. Many deploys a day add up in minutes or credits.
- Currency and card fees. If you pay in a currency other than the dollar, exchange rates and card fees add to the price.
- The domain. It is yearly and billed separately. See how much a domain name costs.
- Pausing at the quota. A site that pauses when the quota runs out costs you sales, not money on the invoice.
To compare with sites that do not use Next.js, see how much it costs to host a website.
How do I cut costs without losing features?#
Generate the pages that rarely change as static, and keep SSR only where content depends on the user. Compress images to WebP or AVIF, because they are usually most of the traffic. Set cache headers for JavaScript and CSS files with a hash in the name. Use output: 'standalone' to ship only the files the server needs. And watch usage in your provider's dashboard before the quota runs out. The publishing walkthrough is in how to host a Next.js app.
How to do this on Square Cloud#
Bandwidth, requests and invocations, the items that weighed most in the math above, are not part of the bill on Square Cloud: traffic is unlimited, with no per-bandwidth or per-request charges (fair-use policy), and you pay the plan, billed in Brazilian reais, by Pix or card. The Next.js app runs as a regular Node.js process (next start or the standalone output) in an always-on container, with no cold start. With the standalone output, start it with HOSTNAME=0.0.0.0 node server.js so the server listens on 0.0.0.0 on the port in the PORT variable. Automatic restart is on by default for dashboard deploys and only kicks in when the process exits with an error.
The platform has no build step: run next build in CI or on your machine and upload the result, or put the build in the start command. In that case, everything the build needs (TypeScript, Tailwind and so on) must be in dependencies, because installation runs with NODE_ENV=production and devDependencies are not installed. If the app fits a static export, use the static sites runtime: nginx is always online serving the out folder, none of your code runs on the server, and a new upload goes live right away.
Every plan is paid. Hobby costs R$12.49 per month, with 1 GB of RAM and 1 vCPU, and covers websites; the plan's RAM is a pool shared across your applications, with a minimum of 512 MB per web application. Every web application gets a *.squareweb.app subdomain with HTTPS and cookieless web analytics, with visits, routes and status codes. A custom domain starts on Standard, from R$44.99 per month with 4 GB of RAM. See how to publish in website hosting.
Website hosting
Static and SSR sites with automatic TLS and a global CDN
FAQs
Can I host a Next.js app without paying anything?
Yes, if the app can be exported as a static site (output: 'export') and the usage fits a no-cost tier such as GitHub Pages. With server features, no-cost tiers have tight limits and, in some cases, forbid commercial use.
How much memory does a Next.js app need?
In one test, a minimal Next.js app running next start used around a hundred MB after 200 requests. Real apps, with more pages and libraries, use more. Measure yours and leave headroom. The build usually needs more memory than the running app.
Do I need Vercel to use Next.js?
No. The official documentation lists four paths: a Node.js server, a Docker container, a static export and adapters for platforms. The Node.js server and Docker support every feature.
Why does the bill go up when I did not change anything?
Because traffic, requests and function time are billed by usage. A viral post, search crawlers or an attack raise those numbers, and the overage either lands on the invoice or pauses the site, depending on the platform.
More in Websites
See all 20 articles- What is a static site (and how to host one)A static site is a set of ready-made HTML, CSS and JavaScript files served the same to every visitor. Learn how it works, when to use one and how to host it.
- How much does it cost to host a website?Hosting a website costs anywhere from nothing to a few dozen dollars a month. See what goes into the bill: hosting, domain, traffic and extras, with real limits.
- How much does static site hosting cost?Hosting a static site costs between zero and a few dozen dollars a month in most cases. See how traffic sets the price, with step-by-step math.
- Static vs dynamic website: differences and when to use eachA static website serves ready-made files, the same for everyone; a dynamic one builds each page per request. Compare speed, cost, security, SEO and use cases.