Deploying to Cloudflare - BizzCMS/bizzcms GitHub Wiki
Deploying to Cloudflare
BizzCMS runs on your own Cloudflare account: Workers for the site and admin, D1 for the database, R2 for media and KV for caching. Most small sites fit in Cloudflare's free tier; check Cloudflare's current pricing for your traffic.
1. Create the resources
In a terminal, signed in with npx wrangler login:
npx wrangler d1 create my-site
npx wrangler kv namespace create my-site-cache
npx wrangler r2 bucket create my-site-media
Each command prints an ID. Keep them for the next step.
2. Add a production environment
In wrangler.toml, add an [env.production] section with your Worker name, the D1 database ID, the KV namespace ID and the R2 bucket name, and your domain under routes (or use the workers.dev address while you test). Keep migrations_dir the same as in the default section.
3. Set the secrets
npx wrangler secret put BETTER_AUTH_SECRET --env production
npx wrangler secret put JWT_SECRET --env production
Use long random values (for example 48 random characters) and keep them somewhere safe.
4. Create the database tables
npx wrangler d1 migrations apply my-site --env production --remote
5. Deploy
npx wrangler deploy --env production
6. First sign-in
Open https://your-site.com/auth/register and create your account: the first account on a new site becomes the administrator. Then switch off open registration in Settings if you do not want others to sign up, and invite your team instead. Set up two-step login for the administrator (Users and Security).
After going live
- Fill in Admin › SEO › General: site name, tagline and the company behind the site (SEO).
- Check Settings › API: the API is closed by default, which is right for most sites (API and AI Assistants).
- Check Settings › Cache: public pages are cached for 5 minutes by default and refreshed on every save (Caching and Speed).
- Submit /sitemap.xml in Google Search Console.
- Back up: Cloudflare D1 keeps a point-in-time history (Time Travel) of your database; export it regularly if you want your own copy.
To update later: pull the new BizzCMS version, npm install, test locally, then npx wrangler deploy --env production.