Deploy on Cloudflare Pages
Cloudflare Pages is a free hosting service that connects directly to your GitHub repository. Every time you push new code, Cloudflare automatically rebuilds and redeploys your site. No servers to manage, no bills to pay.
Step 1: Log in to Cloudflare
- Go to dash.cloudflare.com and log in with the account you created during prerequisites
Step 2: Navigate to Pages
- In the left sidebar, expand the Compute section
- Click Workers & Pages
- Click Create application
- Scroll to the very bottom of the page — you'll see a link that says "Looking to deploy Pages? Get started"
- Click that link
Step 3: Connect your GitHub account
- Cloudflare will ask you to connect a Git provider — select GitHub
- Authorize Cloudflare to access your GitHub account
- Choose whether to give access to All repositories or Only select repositories (if you pick select, make sure you include your project repo)
- Click Install & Authorize
You'll be redirected back to Cloudflare.
Step 4: Select your repository
- From the list of repositories, find and select your project repo
- Click Begin setup
Step 5: Configure your build settings
This is the important part. Cloudflare needs to know how to build your project.
Fill in the following:
| Setting | Value |
|---|---|
| Project name | Your project name (this becomes your URL: your-project.pages.dev) |
| Production branch | main |
| Framework preset | React (Vite) |
| Build command | npm run build |
| Build output directory | dist |
Step 6: Deploy
- Click Save and Deploy
- Cloudflare will clone your repo, install dependencies, run your build command, and deploy the output
- This takes 1-2 minutes — you'll see a build log showing each step
When it finishes, you'll see a success message with your live URL.
Step 7: Visit your live site
Your site is now live at:
https://your-project.pages.dev
Open it in your browser. Share it with someone. This is your project, running on the real internet.
How updates work
From now on, every time you push code to the main branch on GitHub, Cloudflare automatically rebuilds and redeploys your site. The workflow is:
- Make changes locally
- Commit and push to GitHub (
git add . && git commit -m "your message" && git push) - Cloudflare detects the push and redeploys — usually within a minute or two
You don't need to touch the Cloudflare dashboard again for routine updates.
What's next?
Your site is live on a .pages.dev URL. If you want to connect a custom domain (like yourname.com), continue to the next page.