English 繁體中文 简体中文

How to create a free website at username.github.io?

Howard Pong Yuen Lam · AI Notes · November 6, 2026 · 5 min read

You can put a website on the internet for free using GitHub Pages. GitHub is a website where people store and share code; GitHub Pages is a free service that turns one of your code folders into a real website. The address of the website is username.github.io, where username is the name you choose when you sign up for GitHub. No credit card is needed and there is no monthly fee.

This note walks through the whole process, from opening a GitHub account to seeing your first page online, using only the GitHub website in your browser — no extra software required.

Watch the walkthrough

Open in Google Drive (no account needed).

What you need before you start

Step 1: Sign up for a GitHub account

Go to github.com and click Sign up. GitHub asks you to enter:

Click Create account.

Step 2: Verify your email

GitHub sends a short numeric code to your email address. Enter that code on the GitHub page to prove you own the email. After that, you can sign in to your new account.

Step 3: Create a repository named username.github.io

A repository is GitHub’s word for a project folder. For a personal website, the repository must have a very specific name: it must be exactly your GitHub username followed by .github.io.

On GitHub, click your profile picture and choose New repository. In the Repository name box, type:

username.github.io

Replace username with your actual GitHub username. For example, if your username is pongyuenlam, the repository name must be pongyuenlam.github.io. If the name does not match your username exactly, the free website address will not work.

Leave the other settings as they are and click Create repository.

Step 4: Create the file index.html

A website is made of files. The first page that visitors see is always called index.html. On your new repository page, click creating a new file.

In the box that asks for the file name, type exactly:

index.html

Then, in the large editing area below, type a simple page. Here is a small example you can copy and change:

<!DOCTYPE html>
<html>
<head>
  <title>My Website</title>
</head>
<body>
  <h1>Hello, world!</h1>
  <p>This is my first website on GitHub Pages.</p>
</body>
</html>

Step 5: Commit (save) the file

At the bottom of the page, click Commit changes. GitHub asks you to confirm the commit; click Commit changes again. A commit is GitHub’s word for saving a version of your file.

Step 6: Wait and view your website

GitHub needs a short time to publish your page. Open a new browser tab and go to:

https://username.github.io

Again, replace username with your actual username. It usually takes about one to two minutes for the page to appear. If you see an error at first, wait a little longer and refresh the page.

Editing your website later

To change your page, go back to your repository, click the index.html file, then click the pencil icon (Edit this file). Make your changes, scroll to the bottom, and click Commit changes twice. Wait about one to two minutes, refresh username.github.io, and your updated page will appear. To refresh, press Cmd + R on a Mac or Ctrl + R on Windows, or click the circular refresh icon in the browser’s address bar.

What you can do next

Limitations

Further reading