Prepare your app
- Add the Node adapter. This installs
@astrojs/nodeand adds it to your config:npx astro add node
- Check that
astro.config.mjsuses standalone mode:import { defineConfig } from 'astro/config'; import node from '@astrojs/node'; export default defineConfig({ adapter: node({ mode: 'standalone' }), }); - Add a start script to
package.json:"scripts": { "build": "astro build", "start": "node ./dist/server/entry.mjs" } - In the project's env vars, add
HOST=0.0.0.0. On Astro 7, also addNIXPACKS_NODE_VERSION=24.
Standalone mode builds a server that starts itself and also serves your static files from dist/client. We set PORT and the server reads it. Instead of the HOST variable you can set server: { host: true } in the config, which does the same thing.
About the Node version: Astro 7 needs Node 22.23.4 or newer, and its CLI stops the build on anything older with Node.js v22.19.0 is not supported by Astro!. We build Node apps on Node 22.19 by default. With NIXPACKS_NODE_VERSION=24 the app builds and runs on Node 24.10 instead. Astro 6 works on the default.
Static sites need the adapter too
Without an adapter, astro build writes plain HTML to dist/ and there is nothing to run, so the build stops with No start command could be found. We don't have a static-files mode for Astro, so keep the Node adapter even for a site with no server code.
That doesn't change how your pages render. Output stays static by default, so every page is still prerendered at build time and the server just sends the files. A page or endpoint with export const prerender = false renders on each request. Set output: 'server' only if you want on-demand rendering to be the default.
Environment variables
Add variables in the project's settings. They're available both while the app builds and while it runs, so build-time values (like framework-public keys) work without extra setup. See Environment variables.
- Only
PUBLIC_variables reach the browser.import.meta.envvalues are replaced when the site builds, so add them before deploying and redeploy after a change. - Prerendered pages read env vars once, at build time. To read a secret on each request, use it in an on-demand page or endpoint, through
astro:env/server(a schema field withaccess: "secret", orgetSecret()). - Don't commit a
.envfile. Use project env vars.
Add a database
Add a Postgres addon and DATABASE_URL is injected automatically. Query it from on-demand pages and endpoints, not from prerendered ones, which run during the build. The database isn't reachable while the app builds, so run migrations in front of the Start command in Settings → Build, for example npx drizzle-kit migrate && node ./dist/server/entry.mjs.
Health check
Every deploy requests your health check path (/ by default) and only goes live once it returns a 2xx or 3xx status. The platform keeps checking it after that. If / returns 404 or needs a login, add a route like /healthz that returns 200 and set it as the Health Check Path in Settings. Otherwise the deploy fails and the previous version keeps serving.
Host an Astro site for free
The Free plan costs nothing and needs no card. It includes:
- One project, live over HTTPS at
<project-slug>.ethiodeploy.app. - 256 MB of memory and half a CPU core.
- A managed Postgres, MySQL or Redis addon with 512 MB of storage. It doesn't expire.
- A redeploy on every push, the same as the paid plans.
The catch is sleep. After 30 minutes without traffic the app stops, and the next request starts it again. We hold that request for up to 30 seconds while the app boots, so the first visitor after a quiet spell waits a little.
A mostly static Astro site is a good fit for the Free plan: the Node server only sends prebuilt files for those pages, which takes little memory. Because of sleep, the first visit after a quiet half hour is slower than the rest.
When the app has to stay awake or needs your own domain, Pro is $10 or 1,399 ETB a month: always on, 1 GB of memory and a 5 GB database.
Deploy
- Sign in with GitHub and install the EthioDeploy app on the repo.
- Click “New Project” and pick the repo.
- Watch the build in the dashboard. When the health check passes, your app is live at
<project-slug>.ethiodeploy.app. Every push to the default branch redeploys, and the old version keeps serving until the new one is healthy.
Troubleshooting
Node.js v22.19.0 is not supported by Astro!
Cause: Astro 7 needs Node 22.23.4 or newer, and the default build uses Node 22.19.
Fix: Add the env var NIXPACKS_NODE_VERSION=24 and redeploy.
No start command could be found
Cause: The project has no adapter or no start script, so the build has nothing to run.
Fix: Add @astrojs/node in standalone mode and "start": "node ./dist/server/entry.mjs".
The app never answered on port $PORT (log says listening on localhost)
Cause: HOST isn't set, so the server listens on localhost only.
Fix: Add HOST=0.0.0.0 in env vars, or server: { host: true } in the config.
A PUBLIC_ variable is empty or out of date
Cause: It's replaced at build time, and it wasn't set (or had another value) when the site was built.
Fix: Set it in the project's env vars and redeploy.
A page shows data from deploy time, not live data
Cause: The page is prerendered, so its code ran once during the build.
Fix: Add export const prerender = false to that page.
Still stuck? Check the deployment's build log in the dashboard, or see Troubleshooting.
Questions
Yes, through the Node adapter. Add @astrojs/node in standalone mode and a start script. Your pages are still prerendered at build time; the Node server serves them. A static build with no adapter has nothing to run, so it fails.
The @astrojs/node server listens on localhost unless HOST is set. Add HOST=0.0.0.0 as an env var, or set server.host to true in astro.config, and redeploy.
Node 22.19 by default. Astro 7 needs 22.23.4 or newer, so add the env var NIXPACKS_NODE_VERSION=24 and it builds and runs on Node 24.10.
Yes. The Free plan runs one project with a 512 MB Postgres database at no cost. The app sleeps after 30 minutes without traffic and wakes on the next request, and the container has 256 MB of memory. Pro ($10/month) keeps it always on with 1 GB.
Ready to deploy?
Sign in with GitHub and pick your repo. No Dockerfile, no YAML.
More guides
All guides on the deploy guides page. Custom domains, env vars, addons and billing are in the docs.