Set up the Node adapter (or a static server), push, and your site is live. Want a working repo first? Deploy the astro starter from Templates.
Server-rendered (SSR)
Add the Node adapter in standalone mode:
npx astro add node
// astro.config.mjs
import { defineConfig } from "astro/config";
import node from "@astrojs/node";
export default defineConfig({ output: "server", adapter: node({ mode: "standalone" }) });
web: env HOST=0.0.0.0 node ./dist/server/entry.mjs
The standalone server reads PORT itself. Use env HOST=…; a bare HOST=… node … prefix fails in a Procfile.
Static output
With the default output: "static", astro build writes dist/. Serve it with a small static server:
npm install serve
"scripts": { "build": "astro build", "start": "serve dist -l $PORT" }
web: npm start
Environment variables
PUBLIC_* variables are inlined at build time, and Wokku config vars are not available during the build. Commit them in .env.production. Server-side secrets go in config vars:
wokku config:set my-app NODE_ENV=production
Deploy
wokku apps:create my-app
git remote add wokku git@git.wokku.cloud:my-app
git push wokku main
Live at https://my-app.wokku.app. First deploy? See the Quickstart.
Troubleshooting
- App crashes or never responds — for SSR, start
dist/server/entry.mjswithHOST=0.0.0.0; for static output, serve on$PORT. - A
PUBLIC_*value is missing — it’s build-time; commit it and redeploy.