# 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.

Source: https://livops.dev/en/hosting/astro-hosting

By Livops team, the people who build and run Livops. Updated 28 November 2026.

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 `build` or `.output` gives a blank page. Set the output to `dist`.
- **Running `astro dev` in production.** The dev server is for your laptop. The build and the start command are what Livops runs.
- **A hard-coded port.** Use `PORT` from 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](https://livops.dev/en/hosting/free-static-site-hosting) for the free path, and [Nuxt hosting](https://livops.dev/en/hosting/nuxt-hosting) or [SvelteKit hosting](https://livops.dev/en/hosting/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

1. [Astro — Deploy your project](https://docs.astro.build/en/guides/deploy/). Checked 28 November 2026.
2. [Astro — On-demand rendering](https://docs.astro.build/en/guides/on-demand-rendering/). Checked 28 November 2026.
3. [Astro — Node.js adapter](https://docs.astro.build/en/guides/integrations-guide/node/). Checked 28 November 2026.
4. [Astro — Environment variables](https://docs.astro.build/en/guides/environment-variables/). Checked 28 November 2026.
