Buy a Domain

Pick a registrar and register your domain name.

Create a GitHub Repository

1
Create a new repository
Go to GitHub → New repository. Name it yourusername.github.io (replace with your actual GitHub username).
2
Check "Add a README file" and click Create
Scroll down, check Add a README file, then click Create repository.
3
Open the web editor
Press . (period) on your keyboard while viewing the repo — this opens VS Code in the browser instantly, no installation needed.
4
Create index.html
In the file explorer, right-click → New File → name it index.html. Delete the existing README.md file.
5
Write your HTML
Write a basic HTML page — a heading, a paragraph, anything. This is your live website.
6
Commit & push
Click the Source Control icon (branch icon in sidebar) → enter a commit message → click Commit & Push. Your changes go live.
🐙
GitHub
github.com — create your repository here

Deploy on GitHub Pages

1
Go to Settings → Pages
Open your repository on GitHub → SettingsPages (in the left sidebar under "Code and automation").
2
Set source to main branch
Under "Source", select Deploy from a branch → choose main branch → / (root) → Save.
3
Visit your site
After a minute, your site is live at https://yourusername.github.io
🚀
GitHub Pages
pages.github.com — free hosting for static sites

Connect a Custom Domain

Point your domain to GitHub Pages using DNS A records, then configure it in your repository settings.

1
Add A records in your domain's DNS manager
Log into your domain registrar → DNS Management → add four A records pointing to GitHub's IP addresses. Set the Host / Name field to @ (meaning the root domain).
Type IP Address (Points To) TTL
A185.199.108.153Auto / 3600
A185.199.109.153Auto / 3600
A185.199.110.153Auto / 3600
A185.199.111.153Auto / 3600

DNS propagation can take up to 24 hours. Your site may not resolve immediately after saving.

2
Set custom domain in GitHub Pages settings
Go to your repo → SettingsPages → Custom domain → enter your domain (e.g. yourdomain.com) → Save. Enable Enforce HTTPS once the certificate is issued.