How to Host Your Site on Cloudflare (Step-by-Step)
Deploying a site doesn’t need to be complex. Here is how to automatically deploy your web app straight from Git to Cloudflare Workers & Pages.
1. Go to Workers & Pages
Log in to your Cloudflare Dashboard and navigate to Workers & Pages > Create application.
2. Connect Your Git Repository
Under the Pages tab, select Connect Git. Authorize your GitHub/GitLab account, choose your repository access (all repos or selected), and pick the repository you want to deploy.
3. Configure Build Settings
Set your project details based on your framework:
- Framework Preset: Select your framework (React, Vue, Astro, Next.js, etc.).
- Build Command: e.g.,
npm run build - Build Output Directory: e.g.,
distorbuild
4. Deploy and Monitor
Click Save and Deploy. Cloudflare will immediately run your initial build — you can track progress live in the Build Log.
5. Add a Custom Domain (Optional)
Once deployed, go to your project’s Custom Domains tab, click Set up a custom domain, and enter your domain name (e.g., yourdomain.com). Cloudflare will handle DNS routing automatically if your domain is managed there.
Deployment using wrangler is good.
Get adipurnamk’s stories in your inbox
Join Medium for free to get updates from this writer.
Prefer the Terminal?
You can also deploy locally using Cloudflare’s CLI tool:
- For Cloudflare Workers:
npx wrangler deploy- For Cloudflare Pages:
npx wrangler pages deploy distDemo
Access your live site from the browser, mine is https://adipurnamk.my.id/





