Deployment Options
About 317 wordsAbout 1 min
2025-10-10
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 decap cms.Start the deployment.
Cloudflare Pages will build and deploy each time you push a change to the production branch.
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:
Define the necessary
.envenvironment variables if you rely on the decap cms.Start the deployment.
Future commits to your production branch will automatically trigger builds and deployments.
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:
Define the necessary
.envenvironment variables if you rely on the decap cms.Trigger the deployment.
Once configured, any change pushed to your production branch will trigger a new preview and deployment.
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.
