Part 1: GitHub Pages¶
This page is part of the Personal Website Setup Guide. If you are joining mid-series, start at the Home page.
GitHub Pages is a free hosting service built into GitHub. It serves your HTML files directly from a repository as a live website. No server configuration, no hosting fees, no build step required.
This part covers creating the repository, adding your HTML file, and enabling GitHub Pages.
Step 1: Create a new repository¶
- Log into GitHub and click the + icon in the top-right corner
- Select New repository
- Name the repository exactly:
yourusername.github.io, replacingyourusernamewith your actual GitHub username. This naming convention is required for GitHub Pages to work. - Set visibility to Public
- Click Create repository
Why the name matters: GitHub treats a repository named
yourusername.github.ioas a special Pages repository. Any other name will not activate the root Pages URL automatically.
Step 2: Add your HTML file¶
Note: If you initialised the repository with a README file during setup, the file will already appear in the repository. Click Add file to add your
index.htmlalongside it.
- Inside your new repository, click Add file then Create new file
- Name the file
index.html - Add your HTML content. A minimal file works to start:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Your Name</title>
</head>
<body>
<h1>Hello, I am Your Name</h1>
</body>
</html>
- Scroll down and click Commit changes
Why index.html specifically: When a browser visits a URL without specifying a file, the server looks for
index.htmlby default. If your file is named anything other thanindex.html, GitHub Pages will not know what to serve and the site will return a 404 error.
Step 3: Enable GitHub Pages¶
- Go to your repository Settings tab
- In the left sidebar, click Pages
- Under Source, select Deploy from a branch
- Under Branch, select
mainand leave the folder set to/ (root) - Click Save
GitHub will display a message: "Your site is live at https://yourusername.github.io"
The message appears immediately, but the site itself may take a few minutes to become accessible. Wait a few minutes, then open your browser and visit https://yourusername.github.io to confirm the site is live.
If it is not appearing after 10 minutes, hard-refresh your browser (Ctrl + Shift + R on Windows, Cmd + Shift + R on Mac).
What you should see¶
After enabling GitHub Pages and waiting a few minutes, visiting https://yourusername.github.io should display your HTML file rendered in the browser.
If the site is not appearing after 10 minutes, see the Troubleshooting page.
Move to Domain Registration to continue.
Written by Douglas Ebhoman, a technical writer based in Prague who builds documentation systems for DevTools and SaaS companies. douglasebhoman.com · LinkedIn