Productivity
How to Deploy a Static Site to Cloudflare Pages in 5 Minutes
October 11, 2026
Ad slot (configure SITE.adsenseClientId + slotId to activate)
One of the perks of a static site is how light publishing it is — no server needed, just upload the build output to a CDN. Cloudflare Pages has a generous free tier and a global network.
Option 1: Direct Upload from Local (Wrangler CLI)
Good if you don’t have a GitHub repo yet and just want a quick publish straight from your own machine.
npm run build
npx wrangler pages deploy dist --project-name=your-project-name
Wrangler will ask you to log in to your Cloudflare account (via browser) the first time, then upload the dist/ folder as a static site.
Option 2: Connect a GitHub Repo
Once the project is pushed to GitHub, you can connect that repo directly from the Cloudflare Pages dashboard so every push auto-deploys (built-in CI/CD, no extra config).
After Deploying
- Cloudflare gives you a free
*.pages.devURL. - A custom domain can be added later from the Cloudflare dashboard without rebuilding.
- Remember to update
siteinastro.config.mjsso the sitemap and canonical URLs point to the right domain.
Ad slot (configure SITE.adsenseClientId + slotId to activate)