Deployment for Astros
Astro deployment is building the site and publishing it to a host. Static sites run astro build to produce a dist folder that any static host or CDN can serve, while SSR sites need an adapter and a server or serverless platform, along with environment variables and a repeatable CI build.
Stage: Delivery · Part of the Astro roadmap · Last reviewed 19 November 2026
What to learn in Deployment
- Run astro build and inspect the dist output
- Preview the production build locally with astro preview
- Deploy a static site to a static hosting service
- Set environment variables for build and runtime
- Automate build and deploy from a Git push
Deployment interview questions
What does astro build produce?
For a static site, it writes HTML, CSS, JavaScript and assets to the dist folder, which you can upload to any static host. With an SSR adapter it also produces a server entry for the chosen runtime alongside the client assets that the server serves.
Why run astro preview before deploying?
The dev server behaves differently from production, for example in bundling and asset URLs. astro preview serves the built output locally, so you can catch broken links, missing environment variables or base path issues before the site goes live.
Where Deployment fits in the Astro roadmap
Deployment belongs to the Delivery stage (intermediate level). Go live.
Back to the full Astro roadmap