Deployment Options
About 322 wordsAbout 1 min
2025-10-10
Deploy to Vercel
Import the project from Vercel.
Vercel will detect Astro automatically. Confirm or set the following values:
- Build command:
astro buildornpm run build - Output directory:
dist
- Build command:
If you use the admin panel or analytics, add the required
.envvariables to the project settings.Trigger the deployment.
Once configured, any change pushed to your production branch will trigger a new preview and deployment.
Deploy to Netlify
Open the Netlify dashboard and click
Add a new site→Import an existing project.Netlify auto-detects Astro. Confirm or set:
- Build command:
astro buildornpm run build - Output directory:
dist
- Build command:
Add any
.envvalues required for the admin panel or analytics features.Start the deployment.
Future commits to your production branch will automatically trigger builds and deployments.
Deploy to Cloudflare Pages
In Cloudflare, go to
Workers and Pages→Create application→ choosePages→Import an existing Git repository.Cloudflare will detect Astro automatically. Confirm or set:
- Build command:
astro buildornpm run build - Output directory:
dist
- Build command:
Define the necessary
.envenvironment variables if you rely on the admin panel or analytics.Start the deployment.
Cloudflare Pages will build and deploy each time you push a change to the production branch.
Deploy to Your Own Server
Build the project:
npm run buildCompress the generated
distdirectory, upload it to your server, and configure a static site host such as Nginx or Apache to serve the files.
