Skip to content

Astro โ€” Run and Build

Requirements:

  • Node.js 18.14+ (LTS recommended)

Create a new site:

Terminal window
npm create astro@latest my-astro-site
cd my-astro-site
npm install

Run locally:

Terminal window
npm run dev

Visit http://localhost:4321

Build for production (output to dist/):

Terminal window
npm run build

Preview the production build:

Terminal window
npm run preview

Deploy dist/ to your static host. Many hosts provide firstโ€‘class Astro adapters or static hosting.