If you’re looking to create your own website similar to this one, but you’re not keen on managing a complex infrastructure, you’re in luck! In this guide, I’ll walk you through the process of setting up a website using Hugo, a static site generator, and hosting it on Cloudflare Pages, a simple and efficient platform for deploying static sites.

While this guide assumes some familiarity with Git repositories, DNS management, Markdown, HTML, and basic Linux commands, you don’t need to be an expert in web hosting to follow along.

What You’ll Need Link to heading

Before we begin, make sure you have the following:

  1. Cloudflare Account: Sign up for a Cloudflare account if you don’t already have one.
  2. GitHub Account: You’ll need a GitHub account to host your website’s source code. You can use any Source Control Management (SCM) platform, but we’ll focus on GitHub for this guide.
  3. Domain Name: While optional, having a domain name adds a professional touch to your website. You can purchase one from Cloudflare or any other domain registrar.
  4. Terraform Experience: Some familiarity with Terraform will be helpful for automating the setup process.
  5. Ideas to Share: Lastly, you’ll need some content or ideas for your website. Whether it’s a blog, portfolio, or project showcase, having something to share is essential.

Setting up the Git Repository Link to heading

To get started, create a new GitHub repository using the template provided by Komailo/template-hugo-coder. The template includes instructions on setting up the repository and using it with Hugo.

Getting a Domain Name Link to heading

While not mandatory, I recommend securing a domain name for your website. You can register a domain through Cloudflare or any other registrar. If you opt for Cloudflare, the free plan will suffice.

Setting up Cloudflare Pages (via Terraform) Link to heading

Now, let’s deploy your website on Cloudflare Pages using Terraform:

  1. Sign Up/Login to Cloudflare: If you don’t have a Cloudflare account yet, sign up on their website. If you’re already a user, log in to your account.
  2. Setup Cloudflare Pages via Terraform: Utilize the Terraform module provided by terraform-modules-cloudflare-pages-hugo to automate the setup process. This module streamlines the configuration of Cloudflare Pages, making deployment a breeze.

With these steps completed, you’ll have your own website up and running, powered by Hugo and hosted on Cloudflare Pages. Feel free to customize the design, add content, and share your creations with the world!