Deploy Astro
Stackpad auto-detects Astro applications and supports both static and server-rendered (SSR) deployments.
Quick deploy
- Push your Astro project to GitHub
- Create a new project on Stackpad and select your repo
- Stackpad detects
astroin your dependencies - Your app is live at
your-project.your-org.stackpad.eu
Static vs. server-rendered
Static (default)
By default, Astro generates static HTML files. Stackpad builds your site and serves the static files with a lightweight web server.
No additional configuration is needed — just push and deploy.
Server-rendered (SSR)
To use server-side rendering, add the Node.js adapter:
npx astro add nodeThis updates your astro.config.mjs:
import { defineConfig } from 'astro/config';import node from '@astrojs/node';
export default defineConfig({ output: 'server', adapter: node({ mode: 'standalone', }),});Stackpad detects the Node adapter and runs your Astro app as a server on port 4321.
Environment variables
Access environment variables in Astro:
---// Server-side (in .astro files, API routes)const apiKey = import.meta.env.API_KEY;---For client-side variables, use the PUBLIC_ prefix:
---const publicUrl = import.meta.env.PUBLIC_API_URL;---Like Next.js NEXT_PUBLIC_*, Astro’s PUBLIC_* variables are embedded at build time and require a rebuild to change.
What’s next?
- Environment variables — manage configuration
- Custom domains — add your own domain