Astro builds to static files — you can deploy anywhere. Here are the three most popular options.
Before You Deploy
- Update
siteinastro.config.mjsto your domain:
export default defineConfig({
site: 'https://yoursite.com',
output: 'static',
});
- Run a production build to make sure everything works:
npm run build
If it succeeds without errors, you’re ready to deploy.
Cloudflare Pages (Recommended)
Cloudflare Pages is free, fast, and integrates with Git. All LiteInk demos run on Cloudflare.
Option A — Git Integration (Auto-Deploy)
- Push your project to a GitHub repository
- Go to dash.cloudflare.com → Workers & Pages → Create
- Connect your GitHub account and select the repo
- Set build settings:
- Framework preset: Astro
- Build command:
npm run build - Build output directory:
dist
- Click Save and Deploy
Every git push to main now triggers an automatic rebuild.
Option B — Wrangler CLI (Manual)
npm run build
npx wrangler pages deploy dist --project-name=my-site
Custom Domain
After deployment, go to your project’s Custom domains tab and add your domain. Cloudflare will handle SSL automatically.
Vercel
- Push to GitHub
- Go to vercel.com → New Project
- Import your repo — Vercel auto-detects Astro
- Click Deploy
Vercel handles builds, CDN, and SSL out of the box. Custom domains are in Project Settings → Domains.
Netlify
- Push to GitHub
- Go to app.netlify.com → Add new site → Import from Git
- Set build settings:
- Build command:
npm run build - Publish directory:
dist
- Build command:
- Click Deploy site
GitHub Pages
GitHub Pages is free but requires a slightly different setup:
- Set
siteandbaseinastro.config.mjs:
export default defineConfig({
site: 'https://username.github.io',
base: '/repo-name',
output: 'static',
});
- Build and deploy using GitHub Actions or the
gh-pagespackage.
Note: GitHub Pages doesn’t support custom error pages or advanced routing rules.
Post-Deploy Checklist
- Test on mobile and desktop
- Check that the sitemap is accessible at
/sitemap-index.xml - Verify
robots.txtis served correctly - Submit your sitemap to Google Search Console
- Check Core Web Vitals with PageSpeed Insights