Skip to content

Astro — Run and Build

Quick start for creating, running, and building an Astro static site.

  • Node.js 18.14+ (LTS recommended)
Terminal window
npm create astro@latest my-astro-site
cd my-astro-site
npm install

Start the dev server (default at http://localhost:4321):

Terminal window
npm run dev

Outputs to dist/:

Terminal window
npm run build

Serve the built site locally:

Terminal window
npm run preview

Upload the contents of dist/ to your static host. Many providers have first-class Astro adapters or support static hosting out of the box.