Cloudflare Account
URL: dash.cloudflare.com
Your hub for hosting, CDN, DNS, Functions, and deployment.
After setup you get access to:
- Pages (hosting)
- Workers / Functions (serverless)
- DNS management
- SSL certificates
- Analytics
- Security features
Everything you need before starting a Cloudflare Pages project — whether migrating from WordPress or building fresh. This page walks you through accounts, tools, and environment setup so you can hit the ground running.
Cloudflare Account
URL: dash.cloudflare.com
Your hub for hosting, CDN, DNS, Functions, and deployment.
After setup you get access to:
GitHub Account
URL: github.com
Version control, auto-deploy integration, and browser-based editing.
Why GitHub?
SendGrid Account
URL: app.sendgrid.com
Email delivery for form submissions. Free tier includes 100 emails/day.
Domain Registrar Access
Access to your domain registrar to point nameservers to Cloudflare or add CNAME records for subdomains.
Common registrars: GoDaddy, Namecheap, Google Domains (Squarespace), Hover, Cloudflare Registrar.
noreply@yourdomain.com)SG.xxxxxxxxxxxxxxxxxxxxxxxx| Service | Free Tier | Notes |
|---|---|---|
| SendGrid | 100 emails/day | Recommended, reliable |
| Resend | 3,000 emails/month | Developer-friendly API |
| Mailgun | 1,000 emails/month (trial) | Good deliverability |
| Postmark | 100 emails/month | Excellent for transactional |
Version: 18+ recommended (LTS) Purpose: Runs Wrangler CLI, build scripts, and Astro
brew install nodecurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bashnvm install 18nvm use 18Download the installer from nodejs.org.
Verify your installation:
node --version # Should show v18.x.x or highernpm --version # Should show 9.x.x or higherPurpose: Cloudflare’s command-line tool for Pages deployment and local development.
npm install -g wranglernpx wrangler login# Opens browser to authenticate with Cloudflarenpx wrangler whoami# Should show your Cloudflare account name and IDPurpose: Version control, deployment, collaboration
xcode-select --install# Or via Homebrew:brew install gitDownload from git-scm.com.
sudo apt install gitVerify:
git --version # Should show git version 2.x.xConfigure your identity:
git config --global user.email "your@email.com"git config --global user.name "Your Name"Recommended: Visual Studio Code (free)
Key extensions to install:
Alternatives: Sublime Text, WebStorm, Cursor, Zed
Purpose: Headless browser for capturing WordPress pages with full fidelity.
npm install playwrightnpx playwright install chromiumPurpose: Run performance audits from the command line.
npm install -g lighthouseOr use per-project without a global install:
npx lighthouse https://your-site.com/ --output=json --chrome-flags="--headless"You need a locally running copy of the WordPress site to crawl.
| Tool | Platform | Free | Notes |
|---|---|---|---|
| Local by Flywheel | Mac, Windows, Linux | Yes | Recommended — easiest |
| DevKinsta | Mac, Windows | Yes | Good if hosting on Kinsta |
| MAMP | Mac, Windows | Yes (limited) | Classic approach |
| Docker + WordPress | Any | Yes | For advanced users |
| wp-env | Any (Node.js) | Yes | Official WordPress tool |
https://sitename.localYou need direct file system access to the WordPress installation:
wp-content/ themes/ # Active theme files plugins/ # Active plugin files uploads/ # Media library cache/ # Cache files (if using caching plugin)Where to find this:
~/Local Sites/<site>/app/public//Applications/MAMP/htdocs//var/www/html/ or similar# Rename plugin folder to disablemv wp-content/plugins/cleantalk-spam-protect wp-content/plugins/cleantalk-spam-protect.disabled
# After crawl, restoremv wp-content/plugins/cleantalk-spam-protect.disabled wp-content/plugins/cleantalk-spam-protectPurpose: Cloudflare’s first-party web framework, perfect for new sites.
Create a new project:
npm create astro@latest my-sitecd my-sitenpm installChoose a template during setup:
Add the Cloudflare adapter:
npx astro add cloudflareVerify everything works:
npm run dev # Local dev servernpm run build # Build for productionFor non-technical content editing, you can add a CMS:
| CMS | Type | Free Tier | Best For |
|---|---|---|---|
| Decap CMS | Git-based | Free (open source) | Simple sites, blog posts |
| Tina CMS | Git-based | Free (3 users) | Visual editing experience |
| Contentful | API-based | Free (5 users) | Larger teams, structured content |
| Sanity | API-based | Free (3 users) | Flexible content modeling |
| Storyblok | API-based | Free (1 user) | Visual editor, component-based |
Create a .env file in the project root (and add it to .gitignore):
# SendGrid API Key (for form email delivery)SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxxxx
# Cloudflare API Token (for configuration scripts)CLOUDFLARE_API_TOKEN=xxxxxxxxxxxxxxxxxxxx
# Zone ID (for Cloudflare API operations)CLOUDFLARE_ZONE_ID=xxxxxxxxxxxxxxxxxxxxLocation: Dashboard > Pages > [Project] > Settings > Environment Variables
Required for forms:
SENDGRID_API_KEY — Your SendGrid API keyChoose the approach that matches your project type:
# Create project directorymkdir cloudflare-builder-<sitename>cd cloudflare-builder-<sitename>
# Initialize npmnpm init -y
# Install dependenciesnpm install playwright wrangler --save-dev
# Install Playwright browsersnpx playwright install chromium
# Create project structuremkdir -p public scripts tests docs
# Create .gitignorecat > .gitignore << 'EOF'node_modules/.env.wrangler/*.DS_Storetest-results/lighthouse-*.jsonEOF
# Initialize gitgit initgit add .git commit -m "Initial project setup"# Create Astro projectnpm create astro@latest cloudflare-<sitename>cd cloudflare-<sitename>
# Add Cloudflare adapternpx astro add cloudflare
# Create .envtouch .env
# Verifynpm run dev# Create project directorymkdir cloudflare-<sitename>cd cloudflare-<sitename>
# Initialize npm (for Wrangler)npm init -ynpm install wrangler --save-dev
# Create project structuremkdir -p public functions/api
# Create basic index.htmlcat > public/index.html << 'EOF'<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Site Name</title></head><body> <h1>Hello World</h1></body></html>EOF
# Create wrangler.tomlcat > wrangler.toml << 'EOF'name = "cloudflare-sitename"compatibility_date = "2024-01-01"pages_build_output_dir = "public"EOF
# Create .gitignorecat > .gitignore << 'EOF'node_modules/.env.wrangler/*.DS_StoreEOF
# Initialize gitgit initgit add .git commit -m "Initial project setup"
# Test locallynpx wrangler pages dev publicClick Create Token
Use the Custom token template
Set permissions:
| Section | Permission | Access |
|---|---|---|
| Zone | Zone Settings | Edit |
| Zone | Firewall Services | Edit |
| Zone | Analytics | Read |
| Account | Account Analytics | Read |
Zone Resources > Include > Specific zone > your domain
Create the token
Copy immediately (shown only once)
Add to your .env file: CLOUDFLARE_API_TOKEN=your_token_here
Before starting any migration or build, confirm everything is in place.
node --versionnpm --versiongit --versionnpx wrangler --versionnpx wrangler whoaminpx playwright --versionnpx astro --versionnpm run dev.env file created with API keys.gitignore includes .env and node_modulesnpm install -g wrangler# Or use npx:npx wrangler login# Fix npm global permissionsmkdir ~/.npm-globalnpm config set prefix '~/.npm-global'echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrcsource ~/.zshrcnpx playwright install chromiumTrust local certificates (Local by Flywheel generates self-signed certs), or use the --ignore-certificate-errors flag in Playwright.
# Find process on portlsof -i :8788
# Kill itkill -9 <PID>