FREE GUIDE Plan 1c · Tested 2026-07-22

Deploy a Static Site to Cloudflare Pages in 10 Minutes

10 minutes · 5 steps · No GitHub required · Every command verified

Want the full pack? All 4 playbooks bundled — VPS hardening, WhatsApp bot, email outreach, HTTPS proxy.

Get the Full Pack →

What You'll End Up With

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.

Prerequisites: Node.js 18+, npm, a Cloudflare account (free tier is fine), and a folder of static files (HTML/CSS/JS/images). Optional: a domain you control.

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:

PermissionAccess
Account · Cloudflare PagesEdit
Account · Workers ScriptsEdit (optional)
Zone · DNSEdit (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.

Never commit these to git. Store them in environment variables. Anyone with the token can deploy or delete your sites.

Step 2: Install wrangler

npm install -g wrangler
Verify: 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
Verify: Open 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:

TypeNameValue
CNAME@your-project.pages.dev
CNAMEwwwyour-project.pages.dev
Verify: curl -I https://yourdomain.com should return HTTP/2 200 and a valid Let's Encrypt cert.

Verification Checklist

CheckCommandExpected
Wrangler installedwrangler --version4.x.x
Auth workswrangler whoamiShows your account email
Deploy succeedswrangler pages deploy ./my-siteURL printed
Preview loadsOpen pages.dev URLSite renders
Custom domain HTTPScurl -I https://yourdomain.comHTTP/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.

This is the free version. The full Operator Playbook Pack includes 4 verified playbooks, monitoring configs, and deploy scripts we use in production.

Get the Full Pack →