Skip to content

Deploy to Cloudflare Pages

Every theme builds to a static dist/ folder, which means it deploys to any static host. Cloudflare Pages is our recommended target — generous free tier, global edge cache, and seamless custom-domain wiring.

Section titled “Option A — Connect a Git repository (recommended)”

The hands-off path. Push your theme to GitHub, point Cloudflare Pages at the repo, every commit deploys automatically.

  1. Push your theme to GitHub (or GitLab / Bitbucket — Cloudflare supports all three):

    Terminal window
    git init
    git add .
    git commit -m "Initial commit"
    git branch -M main
    git remote add origin https://github.com/you/your-site.git
    git push -u origin main
  2. Create a Pages project: dash.cloudflare.com → Workers & Pages → Create → Pages → Connect to Git → select your repo.

  3. Build settings:

    SettingValue
    Framework presetAstro
    Build commandnpm run build
    Build output directorydist
    Root directory/ (leave default)
    Node version20 (or 22)
  4. Environment variables (optional): under “Environment variables (advanced)”, add NODE_VERSION = 20 if your repo doesn’t have a .nvmrc.

  5. Save and Deploy.

The first build takes ~1–2 minutes. Subsequent builds take 30–60 seconds.

Option B — Wrangler CLI (single command from your terminal)

Section titled “Option B — Wrangler CLI (single command from your terminal)”

For when you don’t want Git → CI → deploy in the middle. Useful for client demos.

  1. Install Wrangler (if you don’t already have it):

    Terminal window
    npm install -g wrangler
  2. Authenticate:

    Terminal window
    wrangler login
  3. Build and deploy:

    Terminal window
    npm run build
    npx wrangler pages deploy dist --project-name=my-site

    The bundled deploy:cloudflare script in package.json already wraps this:

    Terminal window
    npm run deploy:cloudflare

    First deploy creates the project on Cloudflare automatically; subsequent deploys publish to the same project.

After the first deploy you’ll have a URL like my-site-abc.pages.dev. To point your own domain at it:

  1. In the Cloudflare Pages dashboard, your project → Custom domains → Set up a custom domain.
  2. Enter your domain (e.g. aurora.dev).
  3. Cloudflare gives you a CNAME / A record to add at your DNS provider. (If your domain is already on Cloudflare DNS, it sets the record for you.)
  4. SSL is automatic — Cloudflare issues a Let’s Encrypt cert within a few minutes.

See Custom domain for the deep dive.

  • Custom domain — point a real domain at this build.
  • Vercel — same theme, different host.
  • Netlify — same theme, a third host (required if you use Netlify Forms).