Skip to main content
All articles
  • Astro
  • Static Hosting
  • Deployment
  • GitHub Pages
  • Netlify
  • Vercel

Astro Hosting (2026): Where to Deploy a Static Astro Site

Published 12 min read

On this page 12 sections

For Astro hosting, start with one question: is your site static? An Astro static site is just a dist/ folder of HTML, CSS and JS, so any static host can serve it, and Cloudflare, GitHub Pages and Netlify all do it for $0 within their limits. To deploy an Astro site, pick by how you want to ship it (Git push, CLI or a plain upload), whether the free tier allows your own domain, and what happens to the bill when traffic shows up.

The hosting is the easy part. The trouble is everything around it: a GitHub Pages site with no CSS, the Astro and Cloudflare docs disagreeing about Pages, a build that dies on the wrong Node version. All three are below. We checked the prices and limits against the vendors' pricing pages and docs on November 5, 2026.

Quick answer: the best Astro hosting by situation

  • Free, Git push-to-deploy, your own domain: Cloudflare. Static requests are free and unlimited, custom domain included.
  • Personal site or docs, already on GitHub: GitHub Pages. $0 for public repos, but it's not allowed to run an online business.
  • Preview deploys and forms on one bill: Netlify. Watch the credits: run out, and every project pauses.
  • No Git, just upload the build, or deploy from Claude Code, with a password option: Hostsmith (we make it).
  • The site runs server code: Netlify, Vercel (Hobby is non-commercial only) or Cloudflare Workers, with an adapter. Skip to If your Astro site needs a server.

Is your Astro site static? What astro build puts in dist/

Probably yes. An Astro static site is the default: output defaults to 'static', which, per the configuration reference, will "Prerender all your pages by default, outputting a completely static site if none of your pages opt out of prerendering."

Run npm run build and Astro writes the finished site to dist/; npm run preview serves that exact build locally. Think of dist/ as your save file: it's the only thing the host needs.

The quick test: open astro.config.mjs. No adapter line means the site is static, and every host here will serve it. Per the Astro docs: "If you're using Astro as a static site builder, you don't need an adapter."

You need an adapter, and a host that runs server code, when the site uses any of these:

  • A page with export const prerender = false (rendered on demand)
  • Server islands
  • Actions or sessions
  • API endpoints that run on each request, such as a form POST handler
  • A CMS with a server-side admin route, like Keystatic's or StudioCMS (our Astro CMS comparison sorts which ones need one)

Older tutorials trip people up here: output: 'hybrid' is gone. Astro 5 removed it, and a static site now opts single pages out of prerendering instead. A guide (or AI answer) that says hybrid predates Astro 5.

One more gotcha, and the first build error a lot of people hit: Node. Astro 7, current as of November 2026, needs Node 22.23.4 or higher, per Astro's install docs (checked November 5, 2026), and odd-numbered versions like 23 aren't supported. The floor has climbed with minor releases (Astro 6 set it at 22.12.0), and 22.23.4 is the newest Node 22 release, so any older 22.x image fails. Pin Node 24 (or 26, if your host offers it yet).

Astro hosting compared: price, limits and deploy method (November 2026)

Prices and limits checked November 5, 2026, on each vendor's pricing page and docs: Cloudflare Workers pricing, Cloudflare Pages limits, GitHub Pages limits, Netlify pricing, Vercel pricing. Hostsmith's prices are from our pricing.

HostFree tierFirst paid planCustom domain on freeDeploy methodsFree-tier strings attachedServer-rendered pagesPassword protection
Cloudflare (Pages or Workers static assets)Static requests free and unlimited; Pages: 500 builds/mo, 20,000 files, 25 MiB per fileWorkers Paid, $5/mo minimumYesGit, Wrangler CLI, dashboard uploadNone listed for static sitesYes, on Workers with the adapterNo shared password; Cloudflare Access emails a one-time PIN (Zero Trust has a free plan)
GitHub PagesPublic repos: 1 GB site, 100 GB/mo soft bandwidthGitHub Pro or a paid org plan, to publish from a private repoYesGitHub ActionsNo online business, e-commerce or SaaS, on any planNoNone
Netlify300 credits/mo: 15 per production deploy, 20 per GB, 2 per 10k requestsPersonal $9/mo (1,000 credits), Pro $20/mo (3,000)YesGit, CLI, Netlify DropEvery project on the account pauses when credits run outYes, with the adapterPro, $20/mo
VercelHobby: 100 GB/mo Fast Data TransferPro, $20/mo per developer seat, $20 usage credit includedYesGit, CLI, Vercel DropPersonal, non-commercial use onlyYes, with the adapterPro plus $20/mo per protected project
Hostsmith (ours)Free plan: 1 site, 5 MB storage, 5 GB/mo bandwidth, hostsmith.link addressStarter $5/mo billed yearly ($9 monthly), 50 MBNo, from Pro ($15/mo billed yearly, $21 monthly)ZIP upload, API and JS SDK from your CI, MCPFree plan shows Hostsmith brandingNo, static output onlyPrivate Sites (password or email whitelist), from Starter

How to deploy Astro to GitHub Pages

GitHub Pages builds with a GitHub Actions workflow. The steps, from Astro's GitHub Pages guide:

  1. Set site and base first (below). This breaks more first deploys than anything else.
  2. Add .github/workflows/deploy.yml, copied from Astro's guide. It runs the official withastro/action@v6.
  3. On GitHub, go to Settings > Pages and set Source to GitHub Actions.
  4. Push to main, and the site goes live.

Now the base thing. A user site at username.github.io only needs site. A project site lives at username.github.io/my-repo, so Astro also needs base, or every CSS and JS path points at the wrong folder and you get a page with no styling:

js
// astro.config.mjs
import { defineConfig } from 'astro/config';

export default defineConfig({
  site: 'https://username.github.io',
  base: '/my-repo', // only for a project site, not username.github.io
});

Got a custom domain? Add a public/CNAME file with the domain in it, set site to https://example.com, and remove base.

The limits: sites "may be no larger than 1 GB", with a soft bandwidth limit of 100 GB a month. A private repo needs Pro or a paid org plan, as our GitHub Pages private repo guide explains. GitHub also says Pages isn't "allowed to be used as a free web-hosting service to run your online business, e-commerce site," or SaaS, on any plan, so a client's shop is out. There's no site password either: see GitHub Pages password protection options and these GitHub Pages alternatives.

How to deploy Astro to Cloudflare (Pages or Workers)

A static Astro site still deploys to Cloudflare Pages, with no adapter. Only server-rendered Astro has to go to Workers.

That's where the search results get muddled. Since adapter v13 (Astro 6), and still in v14, the version Astro 7 uses, Astro's Cloudflare adapter docs say it "no longer supports deployment on Cloudflare Pages." Cloudflare's own Pages guide for Astro, updated April 2026, still walks you through Pages. Both are right, because the adapter is only for server rendering:

  • Static Astro on Cloudflare Pages: connect your Git repo, set the build command to npm run build and the output directory to dist. Or upload dist without Git: dashboard drag and drop takes up to 1,000 files (25 MiB each), the Wrangler CLI up to 20,000.
  • Server-rendered Astro on Cloudflare Workers with @astrojs/cloudflare. Cloudflare's Pages-to-Workers migration guide notes that "Workers has a distinctly broader set of features," and it doesn't call Pages deprecated.

Workers serves static sites too. Add a wrangler.jsonc next to package.json that points at your build:

jsonc
{
  "name": "my-astro-site",
  "compatibility_date": "2026-11-05",
  "assets": {
    "directory": "./dist",
    // serve your own 404.html (from 404.astro) for missing paths
    "not_found_handling": "404-page"
  }
}

That not_found_handling line is easy to miss: Pages serves your 404.html on its own, and Workers needs this setting (Cloudflare's static-site routing docs). Workers' default html_handling treats URLs like Pages, so the Pages row in the URL table below applies to both.

Then run npx wrangler deploy after npm run build, or connect the repo under Workers & Pages > Create application (for an Astro project in a repo subfolder, set the project path to that folder).

One trap, from the video Cloudflare Deploy Static Sites: Three methods and a TRAP!: a repo connected with no build step publishes its root, hidden .git folder included. Set the build command and serve dist.

How to deploy Astro to Netlify and Vercel

Netlify

Import the repo, set the build command to npm run build and the publish directory to dist. No adapter needed. No Git? Netlify Drop takes the dist folder in the browser.

The thing to understand is credits. Free gets 300 a month, and a production deploy costs 15: that's 20 deploys before a single visitor shows up. A static Astro site redeploys on every content commit, and a Git-based CMS commits on every save, so a busy blog gets there fast. Deploy previews and branch deploys don't use credits, per Netlify's credit docs. When the balance runs out, "all projects on your account will be paused" until the next billing cycle (Netlify's pricing page). Our Netlify Drop alternatives post does the full credit math. A site-wide password needs Pro; there are Netlify password protection options if that's the only reason to upgrade.

Vercel

Import the repo and check the build command (npm run build) and output directory (dist). No adapter needed. The free Hobby plan includes 100 GB of Fast Data Transfer a month, but Vercel says it "is for personal, non-commercial use." A client site needs Pro: $20 a month per developer seat, $20 of usage included.

Vercel Authentication locks a deploy on every plan, but only to logged-in Vercel users with access, so it suits teammates more than clients. A real password is a Pro add-on at $20 a month per project, so a protected client site runs $40 a month; here are the Vercel password protection workarounds, and our Vercel alternatives if it feels like more platform than a static site needs.

Clean URLs and trailing slashes: what each host does with /about

Quick version: if your old URLs look like /about with no slash, the way Webflow's do, set build.format: 'file' in Astro, and /about keeps working on every host below (on Vercel, add cleanUrls). Change those URLs and you lose what Google indexed; our Webflow export guide covers keeping URLs during the move.

This is the part the docs skip. Astro only decides the file shape:

  • build.format: 'directory' (the default) writes about/index.html, which lives at /about/.
  • build.format: 'file' writes about.html.
  • build.format: 'preserve' mirrors src/pages, handy for a migrated site with mixed URLs.

Astro's trailingSlash option (default 'ignore') only controls the dev server and on-demand pages. For a static build, the host decides:

Hostabout.html (build.format: 'file') at /aboutRequest for /about.htmlabout/index.html (the default)
GitHub PagesServedAlso served/about 301-redirects to /about/
Cloudflare PagesServedRedirects to /aboutServed at /about/
Netlify (Pretty URLs on)Served200 or 301 (docs and a live test differ)/about 301-redirects to /about/
VercelOnly with cleanUrls: true in vercel.json (default false)With cleanUrls, 308 to /abouttrailingSlash unset: /about and /about/ both serve it
HostsmithServedAlso served (200)Served at /about/

Sources: Cloudflare's Serving Pages docs, Netlify's trailing slash support guide, Vercel's vercel.json reference, and Hostsmith's clean-URL behavior as shipped on October 19, 2026. For GitHub Pages, we requested flat pages (with and without .html) and a folder page on mdn.github.io on November 5, 2026.

Netlify's docs describe a 301 from /about.html, while a live netlify.app test in October 2026 got a 200. So run the URL check from our Webflow export guide on your own site before switching DNS.

On Hostsmith, a folder index wins over a flat file, and /about/ doesn't fall back to about.html, so pick one format and stick with it. Where both /about and /about.html answer, add a canonical link tag to your layout and set site in the config, so the two URLs don't compete in search.

What does Astro hosting cost for a real site?

Prices as of November 2026:

  • A personal blog: $0 on Cloudflare or GitHub Pages. Netlify Free works too, as long as you deploy fewer than about 20 times a month.
  • A client business site on its own domain, about 20 GB of traffic a month: $0 on Cloudflare. On Netlify, 20 GB alone is 400 credits, over Free's 300 before deploys and requests, so it's Personal at $9 a month, whose 1,000 credits cover it. Vercel needs Pro at $20 a month, since Hobby is non-commercial. Hostsmith Pro is $15 a month billed yearly ($21 monthly) and covers 50 GB of bandwidth.
  • The same site plus a password-protected staging copy: Netlify Pro, $20 a month. Vercel Pro plus the password add-on, $40. Hostsmith Pro, $15 a month billed yearly ($21 monthly), since it holds 5 sites: production on one, staging behind Private Sites on another. Cloudflare can stay $0 if an emailed PIN through Cloudflare Access, on the Zero Trust free plan, works for your reviewers.

Coming from Webflow? What Webflow hosting costs puts its per-site plans next to these hosts.

If your Astro site needs a server

To deploy an Astro site with on-demand pages, Actions, sessions or a server-side CMS, add an adapter: npx astro add netlify, npx astro add vercel, npx astro add cloudflare or npx astro add node.

Then deploy to the matching host: Netlify, Vercel, Cloudflare Workers (not Pages, since adapter v13), or Node on a VPS or in Docker on Render, Koyeb, Railway or Fly. Static hosts, Hostsmith included, don't run this part.

Hosting an Astro site on Hostsmith (we make it)

Hostsmith runs your live Astro site on a your-site.us.hostsmith.link address, or on your own domain from Pro. You run npm run build yourself, locally or in your own CI, then send dist/ one of three ways:

  1. Upload a ZIP. Zip the dist folder and drop the zipped folder in the dashboard (a ZIP with one top-level folder gets unwrapped). A new upload replaces the site's files at the same address.
  2. Deploy from your own CI with the API or the JS SDK (sites.deploy()). Our Sveltia CMS with Astro post has a full GitHub Actions workflow that builds and deploys on every push.
  3. From Claude Code through the Hostsmith MCP, which every plan includes: ask it to run the build and deploy dist/. The Claude website builder guide walks through it.

Storage is the number to check: the Free plan holds 5 MB, also the per-file limit, so a build with full-size photos can outgrow it. Starter has 50 MB and Pro 500 MB. Private Sites (a shared password or an email whitelist) starts on Starter, handy for a client review copy.

What to know before you pick it:

  • Static output only. If you added an SSR adapter, the site needs another host.
  • No custom 404 page. A missing path shows Hostsmith's own not-found page, not your 404.astro.
  • Not the cheapest for a hobby blog. For a $0 personal site with Git push-to-deploy, Cloudflare or GitHub Pages wins.

Frequently asked questions

Where can I host an Astro site for free?

Cloudflare, GitHub Pages, Netlify Free and Vercel Hobby, each with the limits listed in the comparison table.

Is an Astro site static by default?

Yes, output defaults to 'static'.

Can I host Astro on GitHub Pages, and does it cost anything?

Yes, $0 for public repos, with the official withastro/action workflow.

Does Astro still work with Cloudflare Pages?

A static Astro site does, with no adapter. Server-rendered Astro goes to Workers.

What are the downsides of hosting Astro on Netlify?

Credits: each production deploy costs 15 of Free's 300, and when they run out every project on the account pauses.

Can I deploy an Astro site without Git?

Yes: Netlify Drop, a Cloudflare dashboard upload, or a zipped dist uploaded to Hostsmith.

Pick the URL format first, the host second

Back to the opening question. If your Astro site is static, the host is the easy thing to change later: the same dist/ folder deploys anywhere in this guide. Changing URLs after Google has indexed them is the expensive mistake. So settle build.format, site and your Node version first, then let price and deploy style pick the host.

Got the build? Zip dist and drop it at hostsmith.net to get a live link.