Overview

With a private Git server already running (see the previous video), it’s time to scaffold the actual Hugo site and get it under version control. This guide covers initializing a new Hugo project, adding a theme, and pushing the first commit to your self-hosted Gitea instance.


Hardware / Requirements

  • Gitea already installed and running (see my Private Git Server with Gitea on Proxmox guide if you haven’t set this up yet).
  • Hugo (extended version) installed on your local machine.
  • Git installed locally.

🌐 Prerequisite: You’ll need an empty repository already created on your Gitea instance before the final step below.

Procedure

Step 1: Scaffold the Hugo Site

  1. Open a terminal on your local machine.
  2. Run hugo new site homelablog to create the project skeleton.
  3. cd into the new project folder.
  4. Add a theme as a Git submodule (e.g. PaperMod) under the themes/ directory.
  5. Reference the theme in your hugo.toml configuration file.

Step 2: Initialize Git and Make the First Commit

  1. Run git init inside the project folder.
  2. Add a .gitignore file to exclude the public/ and resources/ build folders.
  3. Stage all files with git add ..
  4. Commit with a clear first message, e.g. git commit -m "Initial Hugo site scaffold".

Step 3: Push to Gitea

  1. In your Gitea web UI, create a new empty repository (no README, no license) named homelablog.
  2. Copy the repository’s remote URL from Gitea.
  3. Add it as a remote: git remote add origin <your-gitea-repo-url>.
  4. Push your first commit: git push -u origin main.
  5. Refresh the Gitea repo page to confirm your Hugo project is now versioned and backed up on your own server.