Host your web app for free on Cloudflare Pages
Mr. Linxed

Mr. Linxed @mrlinxed

About: 👨‍💻 Professional problem solver - 🎧 Music lover Hello! Thanks for checking out my profile. If you haven't yet, make sure to also follow me on my other social media! ⬇️

Location:
The Netherlands
Joined:
Sep 2, 2022

Host your web app for free on Cloudflare Pages

Publish Date: Feb 9 '24
14 4

If you have a Vue / React / Angular or even a simple site that's just an index.html like mine, you can host it using Cloudflare pages, absolutely free.

Let me show you.

Using GitHub / GitLab

A nice feature of Cloudflare pages is that you can deploy your site using GitHub or GitLab. This way, every time you push to your production branch your site will automatically be updated.

1. Create an application

After signing up and logging in to Cloudflare, navigate to workers & Pages using the sidebar and click on _Create application

Arrows pointing at where you click

2. Navigate to pages

Cloudflare seems to hide this feature a bit, so once you've reached the page you see on the image below, you have to click on the tab Pages which is located next to the tab Workers

Arrow pointing at the location of the pages tab

3. Pick how you want to deploy

Next, you'll see a screen that gives you 2 options for deploying your application, one via GitHub / GitLab and the other via direct file upload. We'll handle file upload later in this post. So press on Connect to Git

Showing the options

4. Connect your account and select your repository

Depending on if you want to use GitHub or GitLab, you'll have to select the correct tab. We're using GitHub. If you haven't connected your GitHub account, do this here as well. Afterwards, you can select the repository you want to be deploying to Cloudflare Pages

Connect your GitHub or GitLab pages

5. Save & deploy

After you select the correct repository, you'll have some options. And depending on what kind of projects you use you have different configurations here. Make sure you select the correct production branch, which is probably master or main.

If you're using NPM or Yarn you may want to add a build command. But you can leave this empty.

Once you're done, you click on save & deploy. You're page will be up in just a few seconds.

Final settings

Using the direct upload method

Direct upload is also very easy, all you have to do is fill in a project name & upload the files you need.

The downside is of course, that if you want to update your site, you'll have to do this manually every time.

Direct upload form

What's next

It's good to keep in mind that the free plan has a daily limit of 100.000 requests. But that should be plenty if you're just starting or hosting a portfolio site that doesn't get many hits. For more information look at the pricing page.

If you currently don't have a site yet and want to get something up fast. Check out the template I've made which I also use on my site.

I've written about my site in another post:

That's it for now, have a lovely day!

Comments 4 total

  • Thomas Bnt
    Thomas BntFeb 9, 2024

    Just perfect blog to host an website for free and with good capacities. ✨

    I also using CloudFlare Pages for small pages. Very simple to deploy the code!

    Code is Open Source if you want to check that 💚

  • Michael Tharrington
    Michael TharringtonFeb 9, 2024

    Super helpful guide — appreciate ya sharing! 🙌

  • Bjoern
    BjoernFeb 12, 2024

    Was also thinking about testing Cloudflare to host websites. For the moment, I host my stuff on Vercel because it integrates so well with NextJS, and I have to admit that I totally love it.

    Do you use a framework when hosting your website?

    • Mr. Linxed
      Mr. LinxedFeb 12, 2024

      There is no need to change platforms if you like what you're using!

      My website is so simple. It's an index.html file and a CSS file. It doesn't need any fancy frameworks.

Add comment