# Deploy Astro

Astro is detected from its dependency and `astro.config.mjs`. By default Astro builds static output - and that is how it deploys here: `npm run build` fills `dist/`, and `dist/` is served from the CDN with [free bandwidth](/billing/pricing#static-sites). No server, no region, no cold starts.

## Static (the default)

- **Output directory:** `dist` - change it in [Build settings](/create/build-settings#output-directory) if your config moves it.
- **Environment variables:** static builds run [with the environment's variables set](/platform/environment-variables#build-time-and-runtime), so `PUBLIC_*` values inline as usual. Never put secrets behind the public prefix.
- Islands, view transitions, and client scripts are all just files in the output - nothing special to configure.

## Server mode

With `output: 'server'` and the Node adapter, Astro renders per request and runs as a Node.js container. Server-rendered frontends run under [the SSR policy](/create/scaling#the-ssr-policy): pinned to the **Micro** size, scaling 0-3, behind the edge CDN.

- The Node adapter respects `PORT`, which is set for you.
- Server code reads [environment variables](/platform/environment-variables) at runtime; the image build itself runs [without them](/platform/deployments/builds#environment-variables-at-build-time).

## Which to pick

Content sites, blogs, docs, marketing: **static**. Per-request rendering, form actions, sessions: **server**. Astro's hybrid rendering counts as server mode - it needs the origin.

## Related

- [Frameworks](/platform/frameworks): Everything supported and how detection works.
- [Build settings](/create/build-settings): Output directory and build command overrides.
- [Scaling](/create/scaling): What the SSR policy pins and why.
