As a web developer who has built everything from small portfolios to complex agency sites, I’ve spent years navigating the hosting landscape. The debate between traditional hosting and modern static platforms isn’t just about price—it’s about time, performance, and sanity.
For any site built with a static site generator (SSG) like Hugo or Astro, my default, enthusiastic choice is Cloudflare Pages.
Let’s break down why I moved away from VPS/Shared hosting for my static projects and why I believe Cloudflare is the best choice for small to medium-sized sites.
😫 The “Old Way”: My Problem with VPS/Shared Hosting
For years, the standard developer path was to spin up a $5/month VPS (like from DigitalOcean or Vultr) or grab a cheap shared hosting plan. This still makes sense if you’re running a heavy, dynamic, server-side application like a traditional WordPress or Drupal site.
But for a static site? It’s complete overkill and, in my opinion, a waste of time and money.
Here were my main frustrations:
- You Are the Sysadmin: With a VPS, you’re responsible for everything. Updating the operating system (like Ubuntu), patching Nginx/Apache for security holes, managing firewalls, and setting up SSL certificates (and making sure they renew). This is time I am not spending building features for my clients.
- Slow Global Performance: A VPS lives in one location (e.g., Frankfurt). If your user is in Sydney, they have to fetch all your site’s assets from Germany. This results in high latency and a slow site for a huge portion of your audience. You could set up your own CDN, but that’s more complexity and cost.
- Clunky Deployment: My workflow used to be
hugo(to build my site locally) and thenscporsftpto manually upload thepublicfolder to my server. It’s slow, manual, and error-prone. - Wasted Cost: You pay that $5-$10 every single month, even if your personal portfolio only gets 100 visitors.
For static sites, the benefits of a VPS (like root control) are completely outweighed by the negatives. An article from Liquid Web, while focused on WordPress, does a great job explaining the core benefits of a static architecture, which include better security and faster speeds.
✨ The Modern Way: Static Hosts (Netlify vs. Cloudflare)
Platforms like Netlify and Cloudflare Pages flipped this model. They are built specifically for static assets.
When you use one of them, you get:
- A Global CDN by Default: Your site is automatically cached on servers all over the world. A user in Sydney gets the site from a Sydney server. It’s blazing fast for everyone, with zero setup.
- A Git-Based Workflow: You just connect your GitHub repository. When you
git pusha change, the platform automatically builds your site (runshugoornpm run build) and deploys it. - Zero Server Management: No updates, no security patches, no servers. It just works.
Both Netlify and Vercel are fantastic, but my personal choice is Cloudflare.
🚀 Why I Chose Cloudflare Pages: The “True Free Host”
This is the most important part. When I’m building a site for a client—whether it’s an agency’s business site, a documentation portal, or a personal portfolio—I need a solution that is robust, fast, and cost-effective.
Cloudflare Pages wins for me, primarily because of its free plan.
- The Free Plan Allows Commercial Use: This is the killer feature. Unlike some platforms where the free tier is strictly for “non-commercial” or “hobby” projects, Cloudflare’s free plan for Pages explicitly allows for commercial use. You can run your business or agency website on it, for free, without violating any terms of service. You can see the generosity of their free plan on the official Cloudflare Pages site, which includes unlimited sites, unlimited static requests, and unlimited bandwidth.
- It’s a “True” Free Host: Netlify’s free plan includes 100GB of bandwidth. Vercel’s free plan also has a 100GB limit. For a small blog, that’s fine. But if you have a traffic spike or host a few large images, you can hit that limit. Cloudflare’s free plan offers unlimited static bandwidth. This gives me peace of mind that a client’s site will never suddenly go down or rack up a bill because a blog post went viral.
- The World’s Best CDN: Cloudflare’s core business is its CDN. When you host on Cloudflare Pages, you are using the same world-class network that protects and accelerates millions of the web’s biggest sites. You get that performance for free.
- The Ecosystem: It’s not just a static host. You get Cloudflare Workers (for serverless functions), R2 (S3-compatible object storage), and D1 (serverless SQL) all in the same dashboard, all with generous free tiers. You can start with a simple static Hugo site and gradually add dynamic features (like a contact form or a newsletter signup) using Workers, all within one platform.
🛠️ My Go-To Workflow: Hugo + GitHub Actions + Cloudflare Pages
The user’s prompt specifically mentioned this workflow, and it’s an excellent one.
For a static generator like Hugo or Astro, you have two great deployment options with Cloudflare.
Option 1: The Simple Way (Direct GitHub Integration)
This is what I use for 90% of my projects. It’s the easiest and fastest.
- I create my Hugo site and push the code to a new GitHub repository.
- In the Cloudflare dashboard, I create a new “Pages” project and connect it to that GitHub repo.
- Cloudflare automatically detects it’s a Hugo site. It knows the build command is
hugoand the output folder ispublic. (The official docs for deploying a Hugo site or an Astro site show how simple this is). - I hit “Save and Deploy.”
From then on, every time I git push to my main branch, Cloudflare automatically rebuilds and deploys the site in under a minute.
Option 2: The “Pro” Way (Using GitHub Actions)
This is what the user asked about, and it’s a powerful option if you need more control over your build process. You might use this if you need to:
- Run automated tests (like link checking) before deploying.
- Minify images or run other scripts as part of the build.
- Deploy to multiple environments.
Here is the general flow, which is well-documented in a great article by Caktus Group on how to deploy a Hugo site with GitHub Actions:
- In Cloudflare: Create a new Pages project, but skip the “Connect to Git” step.
- In GitHub (Secrets): Go to your repo’s
Settings>Secrets and variables>Actions. You’ll need to add two secrets:CLOUDFLARE_API_TOKEN: You generate this in your Cloudflare profile.CLOUDFLARE_ACCOUNT_ID: You find this on your Cloudflare dashboard.
- In GitHub (Workflow): Create a file in your repo:
.github/workflows/deploy.yml.
Here is a simple version of that workflow file:
name: Deploy to Cloudflare Pages
on:
push:
branches:
- main # Or 'master', etc.
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true # Fetches your Hugo theme if it's a submodule
fetch-depth: 0 # Fetches all history for .GitInfo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- name: Build
run: hugo --minify
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: "your-project-name" # The name of your project in Cloudflare
directory: "./public" # The folder Hugo builds to
When you push to main, this GitHub Action will check out your code, build your Hugo site, and then use Cloudflare’s wrangler-action to push the public folder directly to Cloudflare Pages.
My Final Recommendation
For any small to medium blog, documentation site, personal portfolio, or agency business site built with an SSG, stop using a VPS.
My personal and professional recommendation is to use Cloudflare Pages. It’s faster for your users, easier for you, and the free plan’s allowance for commercial use and unlimited bandwidth is simply unmatched.
