How to Deploy a Zola Blog to Cloudflare Pages
Table of Contents
random6 blog

Summary: This post explains the process of deploying a Zola blog to Cloudflare Pages for free.
🤔 Why Zola?
There are countless blogging tools out there. However, I am someone who is genuinely obsessed with "speed." Zola is built with Rust. Isn't "Rust = Fast" basically an unwritten rule among developers?
In practice, the build process finishes in the blink of an eye. What’s even more attractive is that you don't have to deal with the "dependency hell" often found in Python or Node.js; a single executable is all you need. It feels significantly faster than Hugo, which I used in the past.
🤑 Why Cloudflare Pages?
Many people initially think of GitHub Pages as the go-to option. However, if you dig a little deeper, you'll find that Cloudflare Pages (CF Pages) offers a much more generous free tier. The build speeds are excellent, and the ability to use a high-performance edge network globally for free was a benefit I couldn't ignore.
🧳 Prerequisites
The requirements are simple:
- Git Account: A place to host your source code (e.g., GitHub).
- Zola Engine: Installed on your local machine (sudo pacman -S zola).
- Cloudflare Account: The new home for our blog.
⚙️ Step 1: Local Setup
- Initialization: Run zola init zola-blog to set up the basic structure.
- Choosing a Theme: I chose the clean tabi theme. I added it using git submodule to make managing future updates easier.
- Organizing Directories: I followed Zola’s standard folder structure, such as content and static.
- Preview: I ran zola serve and accessed localhost:1111 to see the site in action.
🫸 Step 2: Git Push
It would be a waste to keep this only on my computer, so it’s time to share it with the world. With three simple commands—git add ., git commit, and git push—my blog code was safely sent to my GitHub repository. We’re halfway there.
☁️ Step 3: Cloudflare Troubleshooting
Next, I went to the Cloudflare Pages dashboard and created a new project. I connected my GitHub repository, but when I tried to deploy, a problem occurred...!
I ran into a zola: command not found error. This happens because Zola isn't pre-installed on Cloudflare's v3 build image. I tried switching to the v1 image where Zola is available, but that triggered a glibc version compatibility error.
The Solution: In the v3 environment, I used the UNSTABLE_PRE_BUILD environment variable to install Zola manually using asdf:
UNSTABLE_PRE_BUILD: asdf plugin add zola https://github.com/salasrod/asdf-zola && asdf install zola 0.22.0 && asdf global zola 0.22.0 (Note: You can change the Zola version as needed.)🚀 Step 4: The Glory of the "Success" Log
After applying the settings, I clicked the "Save and Deploy" button. A few moments later... the word [Success] appeared. I connected my domain, waited a short while, and the blog was officially live.
👋 Wrapping Up
The combination of Zola and Cloudflare Pages is incredibly powerful. The setup is straightforward, and the resulting site is extremely lightweight and fast. If you're tired of heavy blogging tools or want a small taste of the Rust ecosystem, I highly recommend this setup. Of course, you don't actually need to know Rust to use it...