Astro hosting in 2026: how to deploy an Astro site, static or server
An Astro site is either a folder of static files built to dist, or a Node server started from dist with its adapter. Livops detects Astro, builds it, and serves it on a free static site or a web app, depending on which one you have.
By Livops team, the people who build and run LivopsUpdated
Astro builds to one of two shapes. A content site with no server code is built to static files in dist. An app with server routes or an API uses an adapter and runs as a Node server. Livops reads your package.json, recognises Astro, and sets the build and start commands for you. You can override them in the cabinet or in a livops.json file.
Static or server: which one you have
Look at the astro.config file. If it has no adapter and the pages are built ahead of time, the site is static. Pages that read a request, a cookie or a database at request time need an adapter and run on the server.
A static site is the cheap case. Astro writes it to dist, Livops serves those files, and it costs nothing. A server app is a web app: it runs in memory and is billed by the memory it uses.
Deploying a static Astro site
Use these commands and folder:
- build:
npm run build - output:
dist
Livops publishes the contents of dist as the site. Nothing has to be started, so there is no start command. Every deploy rebuilds the site from the source, so a change in the repository reaches the page after the next deploy.
Deploying an Astro server app
Add the Node adapter to the project, the way the Astro documentation describes, so that the build writes a server entry into dist/server. Then set:
- build:
npm run build - start:
node ./dist/server/entry.mjs
The Node adapter reads the port from the PORT environment variable. Livops sets it, so do not hard-code a port. Listen on the address the adapter gives you and do not change it.
Set the health check path to /, or to a page that always answers. If the check fails, the app is restarted, so a slow or broken home page will look like a crash loop in the logs.
Environment variables
Put secrets and settings in the Variables section of the cabinet. Variables that start with PUBLIC_ are written into the page when it is built, which means a change to one of them needs a new deploy. Variables without that prefix are read by the server at runtime and take effect after a restart.
Common mistakes
- Wrong output folder. A static site with its output set to
buildor.outputgives a blank page. Set the output todist. - Running
astro devin production. The dev server is for your laptop. The build and the start command are what Livops runs. - A hard-coded port. Use
PORTfrom the environment. A fixed port makes the app unreachable on Livops. - Forgetting the adapter. A server page without an adapter fails at build time, because Astro does not know how to run it.
If you deploy a site that uses another framework, the same rules apply: static output is free, a server app is paid by memory. See free static site hosting for the free path, and Nuxt hosting or SvelteKit hosting for the other frameworks that share the same shape.
Questions
Is an Astro site free to host on Livops?
A static Astro site is. Build it to dist and it is served as files. A server Astro app, one with an adapter and on-demand routes, runs as a web app and is paid by the memory it uses.
Why does my Astro site show a blank page or 404 after deploy?
The output folder is wrong. A static site must publish dist, which is Astro's default. If the build wrote somewhere else, set the output folder in the project settings and deploy again.
Why did my PUBLIC_ variable not change after I edited it?
Variables that start with PUBLIC_ are written into the page at build time, not read at runtime. Change the value in the cabinet, then deploy again so the build picks it up.
Sources
- Astro — Deploy your project (docs.astro.build). Checked .
- Astro — On-demand rendering (docs.astro.build). Checked .
- Astro — Node.js adapter (docs.astro.build). Checked .
- Astro — Environment variables (docs.astro.build). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your Astro siteRelated
- SvelteKit hosting in 2026: adapter-node, adapter-static or adapter-autoIn SvelteKit the adapter decides the hosting: adapter-static makes files any static host serves, adapter-node makes a Node server, and adapter-auto picks a serverless platform's own adapter. On Livops an adapter-static build is a free site, and an adapter-node build runs as a web app for 39 credits a month (39,000 so'm); adapter-auto is swapped for adapter-node in the build. Here is which to choose, and how Vercel, Netlify, Cloudflare and Render compare.
- Nuxt hosting in 2026: server-rendered or static, and where to run eachA Nuxt app is either a Node server that nuxt build makes, or a folder of pages that nuxt generate prerenders, and the host you need follows from which. On Livops the static build is a free site, and the server build runs as a web app for 39 credits a month (39,000 so'm); you choose when you import the repository. Here is how Vercel, Netlify, Cloudflare and Render compare.
- Next.js hosting without Vercel: the options comparedNext.js runs on any host that runs Node: next build, then next start, and every feature works, Server Actions and image optimization included. On Livops a repository with next in package.json runs as a server from a push for 39 credits a month (39,000 so'm), and a static export is free. Here is how Vercel, Render, Railway, Fly.io and a VPS compare.
- Free static site hosting in 2026: the free tiers comparedA static site — plain HTML, or a Vite, React or Astro build, or a Lovable export — is free on all five. The differences are the limits: Netlify pauses every site when 300 monthly credits run out, Vercel Hobby is for non-commercial use only, GitHub Pages is not for running a business, and Cloudflare Pages does not count static traffic. On Livops up to 30 sites are free, on your own domain, with no card asked for.
- App not listening on $PORT: why the health check failed after deployThe platform started your app, tried the port it gave it, and nothing answered in time. Almost always the app listens on its own fixed port instead of the PORT variable, listens on localhost (127.0.0.1) instead of 0.0.0.0, or crashed or was still starting when the check gave up. Listen on 0.0.0.0 and the port in PORT, and it passes.
- npm failed with return code 1 (npm ERR! code 1): how to fix the buildnpm failed with return code 1, or npm install exited with 1, is npm ERR! code 1 in newer npm: it only says that a script npm ran exited with code 1. The real error is printed above it: usually a compile or type error, a lockfile out of sync with package.json, or a dependency whose install script failed. Find the first error line above code 1, fix that, and the build passes.