EthioDeploy
DocsPricingDomainsBlogToolsChangelog
Deploy guides/Astro

Deploy an Astro app

Astro runs here as a Node server: add the @astrojs/node adapter, a start script, and two env vars (HOST and the Node version). Prerendered pages stay prerendered, and on-demand pages and endpoints work too.

Last updated November 15, 2026

What we run by default
Detected by
package.json
Install
npm ci / pnpm / yarn (from your lockfile)
Build
npm run build (astro build)
Start
npm start (node ./dist/server/entry.mjs)

These run automatically, so leave the command fields blank. Only override them in Settings → Build if you need something different.

Fix this first: Set HOST=0.0.0.0 or the health check never connects

Astro's Node server reads PORT but listens on localhost unless HOST is set. Inside a container that means nothing outside it can reach the app, so the deploy fails with “The app never answered on port $PORT” while the log says Server listening on http://localhost:3000. Add HOST=0.0.0.0 in the project's env vars.

Prepare your app

  1. Add the Node adapter. This installs @astrojs/node and adds it to your config:
    npx astro add node
  2. Check that astro.config.mjs uses standalone mode:
    import { defineConfig } from 'astro/config';
    import node from '@astrojs/node';
    
    export default defineConfig({
      adapter: node({ mode: 'standalone' }),
    });
  3. Add a start script to package.json:
    "scripts": {
      "build": "astro build",
      "start": "node ./dist/server/entry.mjs"
    }
  4. In the project's env vars, add HOST=0.0.0.0. On Astro 7, also add NIXPACKS_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.env values 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 with access: "secret", or getSecret()).
  • Don't commit a .env file. 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

  1. Sign in with GitHub and install the EthioDeploy app on the repo.
  2. Click “New Project” and pick the repo.
  3. 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

NuxtReact RouterHono

All guides on the deploy guides page. Custom domains, env vars, addons and billing are in the docs.

On this page
Prepare your appStatic sites need the adapter tooEnvironment variablesAdd a databaseHealth checkHost an Astro site for freeDeployTroubleshootingQuestions
Deploying with an agent?Point it at llms.txt. Every guide is in one file there.Open llms-full.txt →
EthioDeploy

Agentic first development and deployment, started in Ethiopia, built for developers everywhere.

Telegram community
Product
PricingAI coding agentAgent mode docsDomainsCLIFree backend hostingHosting in EthiopiaChangelog
Deploy guides
Next.jsNode.jsPythonSvelteKitTanStack StartAstroNuxtReact RouterHonoStrapiDjangoFastAPIFlaskStreamlitExpressNestJSLaravelRailsGoTelegram botDiscord botLovableBoltReplitv0Google AI StudioBase44Firebase StudioClaude Code & Cursor
Compare
vs Herokuvs Vercelvs Rendervs Railwayvs Fly.iovs Netlifyvs KoyebHeroku alternativesVercel alternativesNetlify alternativesRender alternativesRailway alternativesFly.io alternativesReplit alternativesPythonAnywhere alternativesDigitalOcean App Platform alternativesGlitch alternatives
Resources
DocsBlogFree toolsAboutSupportContactllms.txt
© 2026 EthioDeployPay by card in USD or bank transfer in ETBTermsPrivacy