What You'll End Up With
- Static site live on a custom domain with HTTPS
- Free hosting with unlimited bandwidth
- Global CDN — sub-100ms latency worldwide
- One-command redeploys from your local machine (no GitHub push required)
- Preview URLs on every deploy
- Free SSL certificate managed by Cloudflare
Why Cloudflare Pages Over Vercel or Netlify
Cloudflare Pages has a genuinely unlimited free tier — no bandwidth cap, no build-minute cap for direct uploads. Vercel throttles at 100GB/mo and gets expensive fast. Netlify caps at 100GB and 300 build minutes.
The tradeoff: fewer framework-specific integrations. If you're deploying pre-built static HTML (like this site), that doesn't matter. This is exactly how cornelius-ai.com is hosted.
Step 1: Get a Cloudflare API Token
Log in to dash.cloudflare.com/profile/api-tokens and click Create Token. Use the "Edit Cloudflare Workers" template, then edit permissions:
| Permission | Access |
|---|---|
| Account · Cloudflare Pages | Edit |
| Account · Workers Scripts | Edit (optional) |
| Zone · DNS | Edit (for custom domain) |
Copy the token. You won't see it again.
Also grab your Account ID from the right sidebar of any Cloudflare dashboard page.
Step 2: Install wrangler
npm install -g wrangler
wrangler --version should show 4.x.x or newer.
Step 3: Prepare Your Site Folder
Your site can be as simple as a folder with an index.html:
my-site/
├── index.html
├── about.html
├── style.css
└── images/
└── logo.svg
No build step. No framework. Static files, served fast.
Optional: add a sitemap and robots.txt
Create sitemap.xml in the root:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://yourdomain.com/</loc>
<lastmod>2026-07-22</lastmod>
<priority>1.0</priority>
</url>
</urlset>
And robots.txt:
User-agent: *
Allow: /
Sitemap: https://yourdomain.com/sitemap.xml
Step 4: Deploy
Set your credentials as env vars (Bash):
export CLOUDFLARE_API_TOKEN="your-token-here"
export CLOUDFLARE_ACCOUNT_ID="your-account-id-here"
npx wrangler pages deploy ./my-site \
--project-name my-site \
--branch main
PowerShell version:
$env:CLOUDFLARE_API_TOKEN="your-token-here"
$env:CLOUDFLARE_ACCOUNT_ID="your-account-id-here"
npx wrangler pages deploy .\my-site --project-name my-site --branch main
First deploy creates the project. Subsequent deploys update it. You'll see:
✨ Successfully published your site to:
https://my-site.pages.dev
https://your-project.pages.dev in a browser. Your site should load with HTTPS.
Step 5: Attach a Custom Domain
In Cloudflare Dashboard → Pages → your project → Custom domains → Set up a custom domain. Enter yourdomain.com.
Cloudflare provisions the SSL cert automatically. If your domain's nameservers point to Cloudflare, DNS is configured for you. If not, add a CNAME record at your registrar:
| Type | Name | Value |
|---|---|---|
| CNAME | @ | your-project.pages.dev |
| CNAME | www | your-project.pages.dev |
curl -I https://yourdomain.com should return HTTP/2 200 and a valid Let's Encrypt cert.
Verification Checklist
| Check | Command | Expected |
|---|---|---|
| Wrangler installed | wrangler --version | 4.x.x |
| Auth works | wrangler whoami | Shows your account email |
| Deploy succeeds | wrangler pages deploy ./my-site | URL printed |
| Preview loads | Open pages.dev URL | Site renders |
| Custom domain HTTPS | curl -I https://yourdomain.com | HTTP/2 200 |
Troubleshooting
"Authentication error" on deploy
Your token doesn't have Pages · Edit permission, or the Account ID is wrong.
wrangler whoami
Deploy succeeds but custom domain shows "not connected"
DNS hasn't propagated. Give it 5–10 minutes. Check with:
dig +short yourdomain.com
Site returns 404 on subpaths
Cloudflare Pages serves /about.html at both /about.html and /about. If your links use /about/ (trailing slash), you may need to add an index.html inside /about/ instead.
Assets don't update after redeploy
Cloudflare edge cache. Wait 30 seconds, or purge cache in Dashboard → Caching.
Bonus: Deploy from a Script
Wrap the deploy in a script so it's one command:
#!/bin/bash
# deploy.sh
set -e
export CLOUDFLARE_API_TOKEN="$(cat ~/.cf-token)"
export CLOUDFLARE_ACCOUNT_ID="your-account-id"
npx wrangler pages deploy ./site \
--project-name my-site \
--branch main \
--commit-message "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
chmod +x deploy.sh
./deploy.sh
Bonus: Preview Deploys
Push to a different branch name to get a preview URL without touching production:
npx wrangler pages deploy ./site \
--project-name my-site \
--branch preview-copy-tweaks
You'll get a URL like https://preview-copy-tweaks.my-site.pages.dev that's isolated from main.