The Frontend Hosting Guide: Vite, Astro And Next.js Builds

The frontend hosting guide for Vite, Astro, SvelteKit and Next.js builds: files or a server, where the build runs, the fixes you'll need, and what hosts bill.
The OxyPages Team · · 13 min read
You've built something with Vite, Astro, SvelteKit or Next.js. It runs on your machine, npm run build finishes without errors, and now you're staring at a list of hosts that all promise to deploy it in one click.
Most of them can. The trouble is that "deploy" hides three different questions, and the hosts answer them very differently. What does your build actually produce? Where should the build run? And what will the host charge, or do, when you outgrow the free tier?
This is the frontend hosting guide I wish I'd had the first time. It starts with the one question that settles most of the rest, whether your project ends as a folder of files or as a server that has to keep running. Then it goes through the build, the three things that break after a deploy, where the build should run, and what each of the main hosts bills.
Each section is a summary with a link to the post that goes deep on it. Vendor figures come from each vendor's own docs and pricing pages, checked in November 2026. If you only want the side-by-side table of every host, every static host compared side by side has it.
TL;DR: First work out whether your frontend is static (a folder of HTML, CSS and JavaScript) or server-rendered (code that runs on every request). Vite apps, default Astro, Docusaurus, Eleventy, SvelteKit with adapter-static and Next.js with output: 'export' are static, and any static host can serve them. Next.js by default, Astro or SvelteKit with a server adapter, and anything with API routes need a host that runs code, such as Vercel, Netlify, Cloudflare Workers or Render. Then fix the usual three post-deploy bugs (404 on refresh, blank page from a wrong base path, secrets leaking through build variables), decide whether your host builds or your GitHub Actions runner does, and read the free tier's rules as closely as its numbers. Vercel Hobby is non-commercial. Netlify Free pauses every project when its 300 credits run out.
What Does Your Frontend Actually Need: Files Or A Server?
Your frontend needs either somewhere to store files or somewhere to run code, and your framework's build output tells you which. Everything else about your frontend hosting follows from that one answer, so it's worth getting right before you compare a single price.
A static build is a folder. The build runs once, writes HTML, CSS and JavaScript, and from then on any host that can serve files can serve your site. A server-rendered build is a program. Some pages are generated when a visitor asks for them, so the host has to keep your code running.
Here's where the common frameworks land by default:
| Framework | Default output | Static by default? | How to make it static |
|---|---|---|---|
| Vite (React, Vue, Svelte, Solid) | dist | Yes | Already is |
| Astro | dist | Yes | Already is, unless you add a server adapter |
| SvelteKit | Depends on the adapter | No | Use adapter-static and prerender |
| Next.js | .next, for a Node server | No | Set output: 'export', which writes out |
| Nuxt | A server build | No | Run nuxt generate |
| Docusaurus | build | Yes | Already is |
| Eleventy | _site | Yes | Already is |
| Gatsby | public | Yes | Already is |
If you're in a "yes" row, you have the widest choice of hosts and the lowest bills. If you're in a "no" row, you can either switch to static output and accept what you give up, or pick a host that runs code. web.dev's explainer on rendering on the web lays out the trade-offs between those rendering styles properly.
One honest note before going further. Static isn't a lesser choice. A static page has no server to crash, patch or scale, and it can sit on a CDN close to every visitor. Plenty of serious sites don't need anything else.
Step 1: Build It And Find The Output Folder
The output folder is the only thing a static host ever serves, so the first job is knowing exactly what your build writes and where. Upload the project folder instead and you're publishing source code a browser can't run.
Vite Apps
A Vite build writes dist: an index.html, plus an assets folder of hashed JavaScript and CSS files. You upload dist, never the project root, and if the app has a router, the host needs to send unknown paths back to index.html. how to deploy a Vite app from its dist folder walks through a real dist listing and three ways to get it online.
Astro
Astro is static by default. astro build writes dist, with one HTML file per page, and you don't need any adapter at all. An adapter only comes in when you switch a project to server output, and then it needs a host that runs code. how to host an Astro site without a server adapter covers that line, plus the Node version Astro 7 needs.
SvelteKit
SvelteKit decides at build time based on its adapter. With adapter-static and prerendering switched on, it writes a build folder of plain files. Any route that can't be prerendered stops the build unless you set a fallback page, which is a useful early warning. how to build a SvelteKit static site goes through adapter-static and the fallback page for SPA mode.
Next.js As A Static Export
Next.js renders on a server by default. Setting output: 'export' in its config makes it write an out folder you can put on any static host, but you give up request-time features such as Server Actions, middleware, incremental regeneration and the default image optimiser. a static export of Next.js, what works and what breaks lists every trade-off, including the error a fresh create-next-app project can throw when you try. If you need those features, that post's verdict is to stay on Vercel.
Step 2: The Three Things That Break After Deploy

Three bugs account for most "it worked locally" moments with a framework build, and each one has a short, well-understood fix. They're worth knowing before you deploy, because each one looks like a hosting problem and isn't.
A 404 When Someone Refreshes A Page
A single-page app handles its routes in the browser. Click around and it's fine, but refresh /pricing and the server looks for a pricing file, finds nothing, and returns a 404. The fix is a rule that sends unknown paths to index.html, and every host spells it differently: a _redirects file on some, a rewrite in a config file or dashboard on others, and nothing at all on a few. how to fix a 404 on refresh in a single-page app has the rule for each host in one table.
A Blank White Page
If the site loads as an empty page with 404s in the browser console, the HTML is asking for its scripts at the wrong path. That usually happens when the site lives in a subfolder, such as username.github.io/repo/, but was built for the domain root. Vite's base setting controls it. the Vite base path and how to fix blank pages explains when you need it, and when a subdomain host means you never do.
Secrets That End Up In The Browser
Any build variable starting with VITE_ is copied into the JavaScript bundle at build time, so every visitor can read it. The same goes for NEXT_PUBLIC_, PUBLIC_ and REACT_APP_. An API key put there is public, however carefully you stored it on the host. why your Vite environment variables are public covers what's safe to put in one and what belongs on a server.
Step 3: Choose Where The Build Runs
Your build can run on the host's machines or on your own GitHub Actions runner. Both work for every static framework, and the choice decides who you pay in build minutes and how much control you keep.
When the host builds, you connect a repository in its dashboard, tell it the build command and output folder, and every push builds and deploys. That's how Vercel, Netlify, Cloudflare Pages and Render work by default, and it's the easiest route to a preview link for every pull request.
When your runner builds, a workflow file in your repository runs npm ci and npm run build on a GitHub-hosted machine, then uploads only the output folder. It's portable, since changing hosts means changing one step. a GitHub Actions deploy for any static framework build has a workflow you can copy and a worked example on a docs site.
Previews deserve their own decision. A preview is a live copy of a change at its own address, built before anything reaches production. Every major host builds them and keeps them out of search with a noindex header, but locking one with a password for a client is where the costs differ. Vercel charges $20 a month per protected project on Pro, and Netlify includes passwords from Pro. how preview deployments work and what they cost goes host by host.
Step 4: Choose A Host And Understand The Bill

Pick the host on two things together: whether it can run what your build needs, and what its free tier's rules and limits do to you. The numbers matter less than people think. The rules, and what happens at a limit, are what actually strand projects.
| Host | Runs server code? | Free tier rule | At a free-tier limit | Paid starts at |
|---|---|---|---|---|
| Vercel | Yes | Hobby is non-commercial personal use only | Wait 30 days for that feature, in most cases | Pro, $20 a month platform fee, plus $20 per extra deploying seat |
| Netlify | Yes | Commercial projects allowed on Free | Every project on the team pauses until the cycle resets | Personal, $9 a month |
| Cloudflare Pages | Yes, through Workers and Pages Functions | Published limits are builds and files, not a use rule | 500 builds a month; 20,000 files per site | Workers Paid plan |
| GitHub Pages | No | Not for running an online business or e-commerce site | Soft 100 GB a month bandwidth | Part of a paid GitHub plan, for private repositories |
| Render | Yes, as web services | Free instances not meant for production; static sites free to deploy | Bandwidth and build minutes are workspace-wide | Pro workspace, $25 a month flat |
| OxyPages | No | Free is personal and non-commercial | Free pauses at its monthly page views | Lite, $4 / month billed annually |
Each host has its own post where the details live.
Vercel
Vercel is the most capable host here for anything that renders on a server, and its free plan is generous. The catch is a rule, not a number: Vercel's fair use guidelines restrict Hobby to non-commercial personal use, and count being paid to build a site, ads and affiliate sites as commercial. the Vercel Hobby plan, its limits and rules reads the plan closely, and a Vercel alternative for plain HTML sites covers what to do if a static site is the only thing keeping you there.
Netlify
Netlify allows commercial work on Free and meters everything in one currency, credits. Free has 300 a month as a hard limit, a production deploy costs 15, and a gigabyte of bandwidth costs 20. When the balance runs out, every project on the team pauses. what to do when your Netlify credits run out covers the way back and the deploy habit that burns the most credits.
Netlify vs Vercel
Between the two big platforms, the decision usually comes down to how many people deploy. Netlify Pro is $20 a month for the whole team, while Vercel Pro is $20 per deploying seat, so a three-person team pays $20 against $60 before usage. For a server-rendered Next.js app, Vercel is the stronger home. Netlify vs Vercel for a static or framework site prices both for one developer and for three.
Render
Render makes sense for a static frontend when your API or database already lives there. Static sites are free to deploy, but they draw on the workspace's shared bandwidth and build minutes, which are 5 GB and 500 minutes a month on Hobby. how to deploy a Render static site and what it costs has the publish directories, the rewrite rule SPAs need, and what happens with no card on file.
Cloudflare Pages And GitHub Pages
Cloudflare Pages is strong for static sites that might take a traffic spike, with limits written as builds and files rather than bandwidth. Cloudflare now says to start new projects on Workers, which can serve static assets too. In fairness, I should say that OxyPages itself runs on Cloudflare's network.
GitHub Pages is free and fine for documentation and open-source projects, but GitHub says it isn't for running an online business, and publishing a framework build there usually means writing an Actions workflow. Both are compared with the rest in the side-by-side post linked at the top.
Where A Flat-Price Static Host Fits
OxyPages is a static host with one flat monthly price per account, which takes a built folder by upload, from the GitHub Action, or by building from a connected GitHub repository. That last route is new, it's open on every plan, and it builds branch and pull request previews. Environment variables there are build-time only, because nothing runs after the build.
Our free plan is much smaller than Vercel's or Netlify's, and it's personal use only, like Vercel Hobby. So the fair comparison is our Lite plan at $4 / month billed annually, with commercial use and password-protected previews, against Vercel Pro at $20.
When A Server Host Is The Right Answer
Some projects shouldn't be on a static host at all, and it's better to know that before you start than after a week of workarounds. Choose a host that runs code if any one of these is true:
- Pages are generated per request. Server-side rendering, personalised pages, anything that reads cookies on the server.
- You have API routes or functions beside the frontend, and you'd like them deployed together.
- You use Next.js features that need a server, such as Server Actions, middleware, incremental regeneration or
next/imagewith the default loader. - You need runtime secrets. A key a visitor must never see has to live on a server, and a static build can't hide it.
- You want a bigger free tier for many small personal projects. Vercel Hobby's 200 projects and 50 domains per project are hard to beat.
- Your code lives on GitLab or Bitbucket and you want the host to build it. Vercel, Netlify and Render all connect to those.
For a server-rendered Next.js app, Vercel is the best home by a distance. For a mix of functions and static pages, Netlify and Cloudflare Workers are both excellent. OxyPages doesn't run server-side code, so for any project on this list, it's the wrong tool.
A Worked Example: Two Projects, Two Answers
Here's how the four steps play out for two real shapes of project.
A Vite and React dashboard for a small client. It talks to an existing API, and every page is built in the browser.
- Step one: static.
npm run buildwritesdist. - Step two: it uses React Router, so it needs the 404-on-refresh rule, and the API address goes in a
VITE_variable, which is fine because it's an address, not a key. - Step three: one developer, so the host can build it. Previews matter because the client reviews changes.
- Step four: it's commercial, so Vercel Hobby is out. Netlify Free works if it stays inside 300 credits, and a flat-price static host works too. The client wants password-protected previews, which rules out the free tiers either way.
A Next.js store with Server Actions and image optimisation. Product pages revalidate every few minutes.
- Step one: server. A static export would lose Server Actions, revalidation and the image optimiser, which are the features the store depends on.
- Steps two to four collapse into one decision: a host that runs Next.js. That's Vercel Pro first, with Netlify as a capable second.
Same four questions, opposite answers, and both took about five minutes.
What To Do Next
Work through it in order, and stop as soon as you have an answer.
- Run
npm run buildand look at the output. A folder of HTML means static. A.nextfolder or a server entry point means it needs a host that runs code. - If it's static, check the three bugs before you deploy: the refresh rule, the base path, and what's in your public build variables.
- Decide where the build runs. The host's builder for the easiest previews, your Actions runner for portability.
- Read the free tier's rule before its numbers. If the project is commercial, cross Vercel Hobby and every non-commercial free plan off the list.
- Price one real month. Count your production deploys and your bandwidth, and run them through each host's model.
If your build is static and you'd like one flat price with no credit or seat arithmetic, compare the plans. If it needs a server, take it to Vercel, Netlify, Cloudflare Workers or Render, and the posts above will help you read their bills.
FAQ
What Is A Frontend Hosting Service?
It's a place to put the output of a frontend build so browsers can load it. For a static build, the host only stores and serves files from a CDN. For a server-rendered build, it also runs your code on each request, which is why those hosts cost more and meter more.
What Is The Best Free Host For A Vite Or React App?
It depends on the free tier's rules more than its speed. Netlify Free allows commercial projects within 300 monthly credits, Vercel Hobby is excellent but non-commercial, and Cloudflare Pages limits builds and files rather than bandwidth. GitHub Pages works for personal and open-source projects but needs the base path set for a repository subfolder.
Can I Host Next.js On A Static Host?
Only as a static export. Set output: 'export', build, and upload the out folder. You lose request-time features such as Server Actions, middleware and the default image optimiser, so a Next.js app that relies on those belongs on Vercel or another host that runs code.
Do I Need A Server For My Frontend?
Not if every page can be built ahead of time. Most marketing sites, docs, portfolios and dashboards that call an existing API are fully static. You need a server when pages change per visitor, when you have API routes beside the frontend, or when a secret must stay hidden, and that's the point where your frontend hosting becomes application hosting.