Deployment
Deploy your Mostra site to any static hosting platform.
Build for Production
Generate a static build:
npm run build Output is in the dist/ folder, ready to deploy anywhere.
Vercel
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel Or connect your GitHub repo at vercel.com/new for automatic deployments.
Netlify
# Install Netlify CLI
npm i -g netlify-cli
# Deploy
netlify deploy --prod --dir=dist Or drag and drop the dist/ folder at app.netlify.com/drop.
Cloudflare Pages
# Install Wrangler CLI
npm i -g wrangler
# Deploy
wrangler pages deploy dist Or connect your repo at Cloudflare Dashboard.
GitHub Pages
Add to your astro.config.mjs:
export default defineConfig({
site: 'https://username.github.io',
base: '/repo-name',
}); Then use GitHub Actions or push the dist/ folder to a gh-pages branch.
Environment Variables
Set your production site URL in your hosting platform:
SITE_URL=https://yourdomain.com This ensures correct sitemap URLs and canonical links.
Other Platforms
Mostra generates static HTML/CSS/JS, so it works with any static host:
- AWS S3 + CloudFront
- Firebase Hosting
- DigitalOcean App Platform
- Render
- Surge.sh
See Astro's deployment guides for detailed instructions.