Host a website free on Cloudflare, from GitHub or a ZIP.
Sign in with Cloudflare, pick a GitHub project or drop a ZIP of your built site, and press Deploy. It is published to your own Cloudflare account. Opslin's Free plan includes this, and Cloudflare's free plan covers it within its limits.
- Server needed
- None
- Code from
- GitHub, or one ZIP of a built site
- Runs in
- Your own Cloudflare account
- Opslin plan
- Free is enough
Who is this guide for?
You have a website, a front end, a Next.js site or a small serverless backend, and you do not want to rent a server. Apps that need a long-running server, such as Express, belong on a VPS.
What you need
- A Cloudflare account. The site is published into it.
- An Opslin account with a verified email, where you are an Owner or Admin. The Free plan is enough.
- A GitHub repository with
package.jsonorindex.htmlat the top, or one ZIP of a built site withindex.htmlat the top.
Which projects can Cloudflare run?
For a GitHub project, Opslin reads it first and says whether Cloudflare can run it, before anything is created.
| Project | Runs on Cloudflare as |
|---|---|
| Plain HTML | A static site, with no build |
| Vite, Create React App | A static site |
| Astro, Docusaurus, VitePress, SvelteKit static output | A static site |
| Next.js 15 or newer | A Worker, through Cloudflare's OpenNext adapter |
| Nuxt | A Worker |
| SvelteKit with the Cloudflare adapter, Astro with @astrojs/cloudflare | A Worker |
| React Router or Remix for Cloudflare, with a Wrangler config | A Worker |
| Hono, itty-router, Elysia | A Worker |
| Express, Fastify, NestJS, Koa | Not on Cloudflare: use a VPS |
How do I publish my site to Cloudflare?
Connect Cloudflare
Open
Servers, pressAdd serverand chooseDeploy without a server on Cloudflare, or pressConnect Cloudflareon the new app screen.Sign in on Cloudflare's own page and approve access. Only an Owner or Admin of the workspace can connect it.
You sign in on Cloudflare's own page. Pick your project
Import a repository from the
GitHubtab, or for a finished site drop one ZIP underUpload.A ZIP must hold the built files with
index.htmlat the top, not inside another folder.The GitHub tab lists the repositories you allowed. Zip a built site (here the dist folder)cd dist && zip -r ../site.zip .Choose Cloudflare and read the check
Under
Name and where it runs, name the project and pickCloudflare.Opslin shows what it found, such as the framework, or the reason Cloudflare cannot run the project.
Pick Cloudflare for a website or a serverless project. Press Deploy and follow the build
Press
Deploy. If you are asked to connect GitHub in your Cloudflare account, do it once and the deploy continues.When the site is live, open its address. Static sites get a
pages.devaddress and Workers get aworkers.devaddress.Follow the build, then open the address it gives you. Add your domain and variables
On the project page, add a custom domain. For a Worker, the domain's DNS must be in the same Cloudflare account. For a static site whose DNS is somewhere else, add the
CNAMErecord the page shows.Add environment variables there too and mark private ones as
Secret. A Worker picks up the change at once; a static site needsRedeploy to apply, or the next deploy.
How do I know it worked?
- The project page shows the latest deployment as successful.
- The
pages.devorworkers.devaddress opens, and your own domain once it is active. - For a Worker, the routes of your backend answer as expected.
curl -I https://your-site.pages.devWhat does the free plan allow?
Two sets of limits apply: Cloudflare's, for traffic, and Opslin's, for builds.
| Limit | Amount |
|---|---|
| Website traffic | Static file requests free and unlimited |
| Backend (Workers) | 100,000 requests a day, 10 ms CPU each |
| Past the limit | Requests get an error until the daily reset |
| Builds through Opslin | Up to 20 builds a day |
What can go wrong, and how do I fix it?
No package.json and no index.html found
- What it means
- Opslin looks at the top of the repository.
- Fix
- Move the site to the top of the repository, or zip the site's folder and upload it.
package.json has no "build" script
- What it means
- The framework needs a build and there is no script to run it.
- Fix
- Add a
buildscript, check it works on your computer and push.
The project needs a long-running server
- What it means
- It uses a server framework such as Express or Fastify.
- Fix
- Deploy it to a VPS instead.
Next.js is too old for Cloudflare's adapter
- What it means
- Versions before Next.js 15 cannot be built for Cloudflare.
- Fix
- Upgrade Next.js, or run the app on a VPS.
The project uses Cloudflare bindings
- What it means
- Bindings such as D1, KV or R2 in the Wrangler config are not created by Opslin yet.
- Fix
- Remove the bindings, or run the app on a VPS.
A database does not connect from a Worker
- What it means
- Drivers that open a direct TCP connection do not work as they do on a server.
- Fix
- Use Cloudflare Hyperdrive or a driver that connects over HTTP.
Your Cloudflare account has no workers.dev address yet
- What it means
- A new Cloudflare account may not have its Workers address set up.
- Fix
- Open
Workers & Pagesin your Cloudflare dashboard once to create it, then deploy again.
This domain's DNS is not in your Cloudflare account
- What it means
- A Worker can only use a domain whose DNS is in the same account.
- Fix
- Add the domain to your Cloudflare account first, then attach it to the project.
What should I do next?
- Next.js on a server insteadA long-running Next.js server on your VPS.Next.js guide
- Apps with a backend serverExpress, NestJS and other Node.js apps.Node.js guide
- How Opslin worksCloudflare, VPS and AWS side by side.How it works
Questions people ask
Is hosting on Cloudflare really free?
Opslin's Free plan includes it, and Cloudflare's free plan covers it within its limits. If you choose a paid Cloudflare plan, Cloudflare bills you for it. See pricing
Where does my website run?
In your own Cloudflare account.
Can I use my own domain?
Yes. Custom domains with SSL on Cloudflare projects are in every plan.
Can I host a backend too?
Serverless backends run as Workers. Apps that need a long-running server need a VPS.
How do I publish a new version?
Redeploy a GitHub project from its project page, or upload a new ZIP for an uploaded site.
Related pages
Try it with your own project.
- Free plan: 1 server and 2 apps
- Your server or your Cloudflare account