Skip to content

Astro + Cloudflare Pages - General Usage Guide

Deploying Astro (Starlight) documentation sites to Cloudflare Pages is fast, secure, and scalable. Here’s a general overview:

  • Global CDN: Fast delivery worldwide
  • Free SSL: Automatic HTTPS
  • Git Integration: Deploy on every push
  • Zero Config: No server management
  • Preview Deployments: Test changes before going live
  • Custom Domains: Use your own or a free *.pages.dev subdomain
  1. Create your Astro (Starlight) site
    Terminal window
    pnpm create astro@latest -- --template starlight
    pnpm install
    pnpm run build
  2. Push to GitHub/GitLab
  3. Connect to Cloudflare Pages
    • Set build command: pnpm run build
    • Set output directory: dist (or your custom build dir)
  4. Deploy!
  • Use preview deployments for PRs
  • Configure custom domains in the Pages dashboard
  • For advanced control, use the Wrangler CLI
FeatureBunpnpm
LanguageJavaScript/TypeScript runtime + package managerNode.js package manager
Install SpeedVery fast (native, parallel)Fast (symlink-based, parallel)
Disk Space UsageLow (single global cache)Very low (symlinks, global store)
CompatibilityNode.js, npm, Yarn, some edge casesnpm, Yarn, Node.js
Monorepo SupportBasic (improving)Excellent
CLI SimplicityAll-in-one (run, test, install)Focused on package management
EcosystemNewer, growingMature, widely adopted
Scriptsbun run, bun test, bun installpnpm run, pnpm install
Windows SupportPartial (improving)Full
Community/DocsGrowing, activeLarge, mature

Summary:

  • Bun is an all-in-one JavaScript runtime and package manager, extremely fast, and great for new projects or those wanting a single toolchain. Still maturing for some advanced/edge use cases.
  • pnpm is a mature, fast, and disk-efficient package manager for Node.js, ideal for monorepos and large projects.