How I Created My Own Hosted Blog Using Hugo and Firebase

I’ve always wanted to create a blog of my own curated, personal, and hosted under my own domain, all without spending a dime. Recently, I discovered Hugo, a static site generator, and it lit a fire in me. I realized I didn’t need to write much code to publish my thoughts, and nothing could stop my scribbles from finding a home on the internet. Creating a blog with Hugo is surprisingly simple even someone with basic coding knowledge can do it. Best of all, it’s free, as long as you already have a domain name.

Pairing Hugo with Firebase Hosting turned out to be the perfect combo for me. Hugo takes care of generating a fast, static site, and Firebase delivers it globally super quick and totally free. The best part? With GitHub Actions in the mix, the whole thing gets deployed automatically whenever I make changes. Just push and forget it’s live!

In this guide, I’ll walk you through everything I did to bring my blog to life from setting up Hugo to getting it online with Firebase and automating the whole process. Here’s what we’ll cover:

  • Spinning up a Hugo blog from scratch
  • Installing a theme (I went with hugo-narrow, but you can pick your vibe)
  • Setting up Firebase Hosting with multi-site support
  • Automating deployments using GitHub Actions so it all just works

1. Setting Up Hugo

First things first, I had to set up Hugo, the static site generator that makes blogging super fast and code light. Installing it was quick and painless, and once it was on my machine, I was ready to roll.

Installing Hugo

BASH
brew install hugo           # macOS
sudo apt install hugo       # Linux
choco install hugo-extended # Windows
Click to expand and view more

Once installed, check if it’s working:

BASH
hugo version
Click to expand and view more

You should see the version number show up. If you do great! Hugo is ready.


Creating Blog Project

With Hugo installed, it was time to kick things off by actually creating the blog project. This part was surprisingly easy just a single command, and Hugo sets everything up for you.

BASH
hugo new site my-blog
cd my-blog
Click to expand and view more

This gives you a fresh project folder with all the basic structure you’ll need layouts, content folders, config files, the works.

At this point, the blog is still a blank canvas. Next step: adding some style with a theme.

Adding the Theme to Your Blog

A blog with no theme is just… sad markdown. I wanted something simple, clean, and minimal after a bit of browsing, I went with hugo-narrow. It’s lightweight and just works.

Theme Link: https://hugo-narrow-docs.vercel.app/

BASH
git init
git submodule add https://github.com/tom2almighty/hugo-narrow.git themes/hugo-narrow
# Update submodules
git submodule update --init --recursive --remote
Click to expand and view more

Update hugo.yaml:

THEME:
baseURL: 'https://example.com'  # Change to your website URL
title: 'My Blog'  # Change to your website title
Click to expand and view more

Adding a Post

Time to write! Hugo makes it super simple to create new blog posts. Just one command, and you’ve got a ready to edit Markdown file waiting for your words.

BASH
hugo new posts/my-first-post.md
Click to expand and view more

Edit the front matter:

PLAINTEXT
title: "My First Post"
date: 2025-06-13
draft: false
categories: ["Blog"]
tags: ["Hugo", "Tutorial"]
Click to expand and view more

Change the title, write whatever you want below it, and when you’re ready to publish, set draft: false.

Building the Site

To preview your site locally:

BASH
hugo server -D
Click to expand and view more

This generates the static files in the public/ folder. You can now visit http://localhost:1313 in your browser to view your website.

2. Going Live with Firebase Hosting

Writing’s fun, but getting your blog on the internet? That’s where the magic happens. I decided to go with Firebase Hosting-it’s fast, free, and plays nicely with Hugo. Let’s set it up.

Install Firebase CLI

You’ll need the Firebase CLI to deploy stuff:

BASH
npm install -g firebase-tools
Click to expand and view more

Then log in to your Firebase account:

BASH
firebase login
Click to expand and view more

Initialize Firebase Hosting (Multi-site)

I chose to go with Firebase’s multi-site hosting because I host both my personal portfolio and my blog under the same Firebase project. Of course, you can choose to keep them separate if that works better for you.

Now, inside your Hugo project folder:

BASH
firebase init hosting
Click to expand and view more

When prompted:

  • Select Use an existing project
  • Choose Configure as a multi-site deployment
  • For the public directory, enter: public

Hugo builds your site into the public folder—so that’s what Firebase needs to serve.

After init, you’ll get:

.firebaserc

JSON
{
  "projects": {
    "default": "Your-Blog-Name"
  },
  "targets": {
    "Your-Blog-Name": {
      "hosting": {
        "blog": ["Your-Blog-Name"]
      }
    }
  }
}
Click to expand and view more

firebase.json

JSON
{
  "hosting": [
    {
      "target": "blog",
      "public": "public",
      "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
    }
  ]
}
Click to expand and view more

Make sure the target name matches what you’ll use in GitHub Actions later (like hosting:blog).

Test a Local Deploy (Optional)

Want to test it before going full CI/CD? If you see your blog live at the Firebase URL—nice job!

BASH
hugo --minify
firebase deploy --only hosting:blog
Click to expand and view more

3. Push Your Blog to GitHub

Initialize a Git repository if not already done:

BASH
git init
git add .
git commit -m "Initial Hugo blog setup"
git remote add origin https://github.com/your-username/your-repo.git
git push -u origin main
Click to expand and view more

Make sure your code lives in the main branch, our GitHub Actions workflow will watch that.

4. Automate It with GitHub Actions

Manual deploys are fine… once. Let’s automate it so your blog goes live every time you push.

Generate a Firebase Token

One-time thing—this gives GitHub permission to deploy:

BASH
firebase login:ci
Click to expand and view more

Copy the token it gives you.

Add the Token to GitHub Secrets

Go to your GitHub repository:

  • Settings → Secrets and Variables → Actions
  • Click New repository secret
    • Name: FIREBASE_TOKEN
    • Value: (paste the token you copied)

Create the Workflow File

Now let’s create the GitHub Actions config:

.github/workflows/deploy.yml

YAML
name: Deploy Hugo blog to Firebase

on:
  push:
    branches:
      - main

jobs:
  build-deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'

      - name: Build Hugo site
        run: hugo --minify

      - name: Install Firebase CLI
        run: npm install -g firebase-tools

      - name: Deploy to Firebase Hosting
        env:
          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
        run: |
          firebase deploy --only hosting:blog
Click to expand and view more

5. Final Push & Deploy

All done? Time to push and watch the magic happen.

Trigger a deploy:

BASH
git add .
git commit -m "New blog post"
git push origin main
Click to expand and view more

That will trigger your GitHub Actions workflow, build your Hugo blog, and deploy it to Firebase automatically!

Optional: Clean Up Extra Workflows

If you experimented with multiple .yml files under .github/workflows/ (like I did), make sure to remove or rename any that you’re not using to avoid duplicate workflow runs.

BASH
rm .github/workflows/preview.yml
git commit -am "Remove unused workflow"
git push origin main
Click to expand and view more

Summary

StepWhat You Did
1.Created a Hugo blog and picked a theme
2.Built and previewed your site using hugo server -D
3.Configured Firebase Hosting with multi-site targets
4.Added a deploy token to GitHub Secrets
5.Created a GitHub Actions workflow for deployment
6.Pushed to main to trigger automatic deploys

And we are done!

You now have:

  • A working Hugo-based blog
  • Firebase Hosting with target-based deployment
  • CI/CD using GitHub Actions from the main branch

Want to add features like analytics, comments, or a newsletter? Drop a comment below or ping me and I’ll write a follow up!

Copyright Notice

Author: Padmaj P Kumar

Link: https://blog.padmajp.com/posts/how-i-created-my-own-hosted-blog-using-hugo-and-firebase/

License: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

Comments

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut