Skip to content
Early bird + Black Friday · 73% off

Get ZeroDirs for $179 $49

Claim $49 deal

Go live

A ZeroDirs site is static files plus a small Worker. pnpm cf:setup builds the Cloudflare side of it from site.url in site.config.ts.

  1. Check the account and the domain.

    Terminal
    pnpm exec wrangler whoami # not signed in? pnpm exec wrangler login
    pnpm check:config # site.config.ts OK — <your site> (https://your-domain.com)

    site.url must be your own domain: https://, no trailing slash, zone on this account.

  2. See the plan. Nothing changes yet.

    Terminal
    pnpm cf:setup --dry-run
    Plan:
    Worker name acme-directory (renamed from the template)
    Route acme.com (custom domain) (changes wrangler.jsonc)
    D1 database acme-directory (create)
    R2 bucket acme-directory-media (create if missing)
    Then migrations → build → deploy → TOKEN_SECRET
    Nothing changed.
  3. Run it. It asks once and skips what is already done.

    Terminal
    pnpm cf:setup
  4. Nothing to store. If .env still held the placeholder TOKEN_SECRET, cf:setup generates one, saves it to .env and sets it on the Worker; the admins are the addresses in admin.emails, and they sign in like anybody else.

  5. Read “What is left”.

    Done. The site is at https://acme.com
    What is left:
    • Paid plans are on: pnpm cf:secrets STRIPE_SECRET_KEY STRIPE_WEBHOOK_SECRET, …
    • Sign in at /login/ as you@acme.com — with Google, or with a password set through "Forgot password?" so the address is proven — and /admin/ will list anything this configuration still needs.
Message Fix
site.url is still … Point site.url at your domain, re-run
R2 could not create the bucket One-time R2 sign-up: dashboard → R2 → Get started
the domain does not answer after a few minutes Add the zone to this Cloudflare account, re-run
Terminal
pnpm exec wrangler login
pnpm exec wrangler d1 create acme-directory # paste the id into wrangler.jsonc → d1_databases[0].database_id
pnpm exec wrangler r2 bucket create acme-directory-media
pnpm cf:typegen # worker-configuration.d.ts follows the bindings
pnpm db:migrate:remote
pnpm check:config
pnpm deploy # = astro build && wrangler deploy
pnpm cf:secrets TOKEN_SECRET

Set name and routes in wrangler.jsonc first.

Command or URL You should see
Everything at once pnpm cf:doctor cf:doctor — N ok, 0 warnings, 0 problems; anything else names the fix
The site https://<your domain>/ your home page, your name in the footer
The admin https://<your domain>/admin/, signed in as an address in admin.emails the review queue; it reports what is still missing
The Worker’s secrets pnpm cf:secrets --list what is set, and what site.config.ts still needs
  • site.url bakes into canonicals, the sitemap, the feeds and the OG images at build time — change it and deploy again.
  • Without a domain on Cloudflare, pnpm cf:setup --workers-dev deploys to <worker-name>.<your-subdomain>.workers.dev with no route; re-run without the flag once site.url is your domain.
  • cf:setup leaves the send_email binding out when your account cannot send mail yet.
  • pnpm cf:secrets sends every runtime secret in .env.prod in one request and never prints a value; --dry-run shows the plan first, and a name (pnpm cf:secrets STRIPE_SECRET_KEY) sends only that one.
Step Why Page
Make uploaded images public pnpm cf:media: private bucket, media.baseUrl still on the demo Logos and media
Give the builder the real database Workers Builds / Actions need the three D1 credentials; the site you just deployed was built from your local database The build’s database
Deploy on every push, and after every approval pnpm cf:ci --enable turns the GitHub Actions workflow on Deploy on git push, then Publishing on approval
Send mail Receipts and approvals wait in the outbox Email
Take money Paid plans need two Stripe secrets and a webhook Plans and payments
Let submitters sign in with Google Email and password already work; Google is optional Submitter accounts
  • Directoryscripts/
    • cloudflare-setup.ts — the command itself, step by step, with --dry-run, --workers-dev and --yes
    • cf-media.ts — pnpm cf:media: the bucket’s public URL, written into site.config.ts
    • cf-doctor.ts — pnpm cf:doctor: the read-only check, and --manual for the dashboard-only steps
    • dev-setup.ts — what pnpm dev runs first: .env from the example, local migrations, the demo seed while the database is empty
  • wrangler.jsonc — name, routes, the D1 id and the R2 bucket are written here
  • worker-configuration.d.ts — regenerated from the bindings; pnpm check type-errors without it
  • .env — gitignored; TOKEN_SECRET ends up here as well as on the Worker