Skip to content

Prerequisites

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

RequiredFree

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

GitHub Account

RecommendedFree

URL: github.com

Version control, auto-deploy integration, and browser-based editing.

Why GitHub?

  • Cloudflare Pages auto-deploys from GitHub on every push
  • GitHub web editor enables browser-based content editing (no local tools)
  • Full version history and rollback capability
  • Collaboration features (PRs, reviews)

SendGrid Account

If Forms NeededFree Tier

URL: app.sendgrid.com

Email delivery for form submissions. Free tier includes 100 emails/day.

Domain Registrar Access

For Custom Domains

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.


  1. Go to dash.cloudflare.com/sign-up
  2. Create account with email + password
  3. Verify your email address
  4. Add your domain (or do this later)
  5. Note your Account ID (visible in dashboard URL or Overview page)
  1. Go to signup.sendgrid.com
  2. Create your account
  3. Complete Single Sender Verification:
    • Navigate to Settings > Sender Authentication
    • Verify a “from” email address (e.g., noreply@yourdomain.com)
  4. Create an API Key:
    • Settings > API Keys > Create API Key
    • Permission: “Mail Send” (minimum)
    • Copy the key immediately (you will not see it again)
    • Format: SG.xxxxxxxxxxxxxxxxxxxxxxxx
ServiceFree TierNotes
SendGrid100 emails/dayRecommended, reliable
Resend3,000 emails/monthDeveloper-friendly API
Mailgun1,000 emails/month (trial)Good deliverability
Postmark100 emails/monthExcellent for transactional

Version: 18+ recommended (LTS) Purpose: Runs Wrangler CLI, build scripts, and Astro

Terminal window
brew install node

Verify your installation:

Terminal window
node --version # Should show v18.x.x or higher
npm --version # Should show 9.x.x or higher

Purpose: Cloudflare’s command-line tool for Pages deployment and local development.

  1. Install globally:
    Terminal window
    npm install -g wrangler
  2. Authenticate with Cloudflare:
    Terminal window
    npx wrangler login
    # Opens browser to authenticate with Cloudflare
  3. Verify:
    Terminal window
    npx wrangler whoami
    # Should show your Cloudflare account name and ID

Purpose: Version control, deployment, collaboration

Terminal window
xcode-select --install
# Or via Homebrew:
brew install git

Verify:

Terminal window
git --version # Should show git version 2.x.x

Configure your identity:

Terminal window
git config --global user.email "your@email.com"
git config --global user.name "Your Name"

Recommended: Visual Studio Code (free)

Key extensions to install:

  • Astro — for Astro projects
  • HTML CSS Support — for HTML editing
  • Prettier — code formatting
  • Live Server — local preview

Alternatives: Sublime Text, WebStorm, Cursor, Zed


Playwright WordPress Migration Only

Section titled “Playwright ”

Purpose: Headless browser for capturing WordPress pages with full fidelity.

Terminal window
npm install playwright
npx playwright install chromium

Purpose: Run performance audits from the command line.

Terminal window
npm install -g lighthouse

Or use per-project without a global install:

Terminal window
npx lighthouse https://your-site.com/ --output=json --chrome-flags="--headless"

WordPress Migration: Additional Requirements

Section titled “WordPress Migration: Additional Requirements”

Local WordPress Environment Required

Section titled “Local WordPress Environment ”

You need a locally running copy of the WordPress site to crawl.

ToolPlatformFreeNotes
Local by FlywheelMac, Windows, LinuxYesRecommended — easiest
DevKinstaMac, WindowsYesGood if hosting on Kinsta
MAMPMac, WindowsYes (limited)Classic approach
Docker + WordPressAnyYesFor advanced users
wp-envAny (Node.js)YesOfficial WordPress tool
  1. Download from localwp.com
  2. Create new site or import existing
  3. Pull database and files from production
  4. Site will be available at https://sitename.local

WordPress File Access Required

Section titled “WordPress File Access ”

You 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 by Flywheel: ~/Local Sites/<site>/app/public/
  • MAMP: /Applications/MAMP/htdocs/
  • Server: /var/www/html/ or similar
  • Hosting panel: File Manager > public_html/
Terminal window
# Rename plugin folder to disable
mv wp-content/plugins/cleantalk-spam-protect wp-content/plugins/cleantalk-spam-protect.disabled
# After crawl, restore
mv wp-content/plugins/cleantalk-spam-protect.disabled wp-content/plugins/cleantalk-spam-protect

Purpose: Cloudflare’s first-party web framework, perfect for new sites.

  1. Create a new project:

    Terminal window
    npm create astro@latest my-site
    cd my-site
    npm install
  2. Choose a template during setup:

    • Minimal — Empty project
    • Blog — Blog with content collections
    • Starlight — Documentation site
    • Portfolio — Portfolio/showcase
  3. Add the Cloudflare adapter:

    Terminal window
    npx astro add cloudflare
  4. Verify everything works:

    Terminal window
    npm run dev # Local dev server
    npm run build # Build for production

Astro CMS Integrations Optional

Section titled “Astro CMS Integrations ”

For non-technical content editing, you can add a CMS:

CMSTypeFree TierBest For
Decap CMSGit-basedFree (open source)Simple sites, blog posts
Tina CMSGit-basedFree (3 users)Visual editing experience
ContentfulAPI-basedFree (5 users)Larger teams, structured content
SanityAPI-basedFree (3 users)Flexible content modeling
StoryblokAPI-basedFree (1 user)Visual editor, component-based

Create a .env file in the project root (and add it to .gitignore):

Terminal window
# 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=xxxxxxxxxxxxxxxxxxxx

Location: Dashboard > Pages > [Project] > Settings > Environment Variables

  1. Go to Settings > Environment Variables
  2. Click “Add variable”
  3. Enter name and value
  4. Select environment (Production / Preview / Both)
  5. Save
  6. Redeploy for changes to take effect

Required for forms:

  • SENDGRID_API_KEY — Your SendGrid API key

Choose the approach that matches your project type:

Terminal window
# Create project directory
mkdir cloudflare-builder-<sitename>
cd cloudflare-builder-<sitename>
# Initialize npm
npm init -y
# Install dependencies
npm install playwright wrangler --save-dev
# Install Playwright browsers
npx playwright install chromium
# Create project structure
mkdir -p public scripts tests docs
# Create .gitignore
cat > .gitignore << 'EOF'
node_modules/
.env
.wrangler/
*.DS_Store
test-results/
lighthouse-*.json
EOF
# Initialize git
git init
git add .
git commit -m "Initial project setup"

  1. Go to dash.cloudflare.com/profile/api-tokens

  2. Click Create Token

  3. Use the Custom token template

  4. Set permissions:

    SectionPermissionAccess
    ZoneZone SettingsEdit
    ZoneFirewall ServicesEdit
    ZoneAnalyticsRead
    AccountAccount AnalyticsRead
  5. Zone Resources > Include > Specific zone > your domain

  6. Create the token

  7. Copy immediately (shown only once)

  8. Add to your .env file: CLOUDFLARE_API_TOKEN=your_token_here


Before starting any migration or build, confirm everything is in place.

  • Cloudflare account created and verified
  • SendGrid account created (if forms needed)
  • GitHub account created (recommended)
  • Domain registrar access confirmed
  • Node.js 18+ installed: node --version
  • npm installed: npm --version
  • Git installed: git --version
  • Wrangler installed: npx wrangler --version
  • Wrangler authenticated: npx wrangler whoami
  • Code editor installed
  • Local WordPress environment running
  • WordPress site accessible at local URL
  • File system access to wp-content
  • Security plugins identified (may need temporary disable)
  • Playwright installed: npx playwright --version
  • Astro installed (if using): npx astro --version
  • Chose project template
  • Local dev server runs: npm run dev
  • .env file created with API keys
  • .gitignore includes .env and node_modules
  • Git repository initialized

Terminal window
npm install -g wrangler
# Or use npx:
npx wrangler login
Terminal window
# Fix npm global permissions
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
source ~/.zshrc
Terminal window
npx playwright install chromium

"SSL certificate error on local WordPress”

Section titled “"SSL certificate error on local WordPress””

Trust local certificates (Local by Flywheel generates self-signed certs), or use the --ignore-certificate-errors flag in Playwright.

Terminal window
# Find process on port
lsof -i :8788
# Kill it
kill -9 <PID>