What you need before starting
- A project that generates static files (Astro, Vite, exported Next.js or plain HTML).
- Your code on GitHub or GitLab and a Cloudflare account.
- A domain (optional to start: you get a free test one).
The steps, in short
- Check the build locally: for example
npm run build, and confirm it generates the output folder (distin Astro). - Connect the repository in Cloudflare and set the build command and output folder.
- Set the environment variables the build needs (public values only).
- Publish: every push to the main branch creates a new deployment, and other branches get a preview.
- Connect your domain from the dashboard; Cloudflare manages DNS and the HTTPS certificate.
- Adjust redirects and headers if you need them (for example,
wwwto the main domain). - Add a light backend with a function or Worker only if you need forms or an API.
Common mistakes
- Setting the output folder wrong and publishing an empty page.
- Using absolute paths from your computer for images or files.
- Forgetting the trailing slash on URLs and ending up with duplicate links or 404s.
- Putting private keys in variables that get embedded in the build.
How we help
We publish your site with automatic deploys, a domain, HTTPS and, if you need them, forms and functions in the same project.