5.7.4
Deploy
Build the Starter as a static site and deploy it with Cloudflare Workers Builds.
This guide is for the Markdown source, the default.
What the build makes
pnpm build
With Markdown, the build is a static site. Astro writes it to dist/. There is no server code.
Tell Cloudflare what to serve
The repo has no Cloudflare config. Add a file wrangler.jsonc at the root of your repo:
{
"name": "my-site",
"compatibility_date": "2026-10-01",
"assets": { "directory": "./dist", "not_found_handling": "404-page" }
}
name must match the name of your Worker in the Cloudflare dashboard. If it does not, the build fails. not_found_handling serves the site’s own 404 page.
Connect the repo
- Push your repo to GitHub.
- In the Cloudflare dashboard, create a Worker from your Git repository (Workers Builds).
- Set the build command to
pnpm build.
Cloudflare then builds the site and serves dist/.
EmDash
With the EmDash source, the build is a server app for Node (@astrojs/node). It keeps its data in a SQLite file (data.db) and its uploads in uploads/. You run it with pnpm start. Set SITE_URL when you run it too: SITE_URL=https://<your-domain> pnpm start, with your own domain in place of <your-domain>. Without it, the links use the address the server sees for each request, which is http://localhost with the port unless security.allowedDomains in astro.config.mjs names your domain, and the log has one line asking for SITE_URL. It does not run on Cloudflare Workers as it ships, so this guide does not cover it.