DEV Community

masoomjethwa
masoomjethwa

Posted on

How to Create and Publish Your Own Web Page Using GitHub Pages

Lets Learn:

  • ๐Ÿง  What GitHub Pages is
  • ๐Ÿ› ๏ธ How to host a self-made HTML page
  • ๐ŸŒ Creating a simple index.html (homepage)
  • โญ Adding a custom favicon
  • ๐Ÿš€ Going live with GitHub Pages

Want to create your own personal website or project page without paying for hosting?
GitHub Pages lets you host static websites (HTML/CSS/JS) for free โ€” and itโ€™s easier than you think.

In this post, youโ€™ll learn how to:

โœ… Set up GitHub Pages
โœ… Create your first index.html homepage
โœ… Add a custom favicon
โœ… Publish your site at https://yourusername.github.io/

Letโ€™s go!


๐Ÿ“ Step 1: Create a GitHub Repository

  1. Go to https://github.com/new
  2. Set your repository name as:
yourusername.github.io 
Enter fullscreen mode Exit fullscreen mode

๐Ÿ‘‰ Replace yourusername with your actual GitHub username (must match exactly).

  1. Choose Public
  2. Leave everything else blank (donโ€™t add README, .gitignore, etc.)
  3. Click Create repository

๐Ÿ›  Step 2: Add Your First Web Page (index.html)

You can do this by uploading files directly via GitHubโ€™s interface:

  1. Click โ€œAdd fileโ€ โ†’ โ€œUpload filesโ€
  2. Create a new file called index.html
  3. Paste the following code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Welcome!</title> <link rel="icon" href="favicon.ico" /> </head> <body> <h1>Hello, world!</h1> <p>This is my first self-hosted page using GitHub Pages.</p> </body> </html> 
Enter fullscreen mode Exit fullscreen mode
  1. Scroll down and click โ€œCommit changesโ€

๐ŸŒŸ Step 3: Add a Favicon (optional but cool)

A favicon is the small icon you see in browser tabs.

  1. Create or download a favicon.ico (you can use favicon.io)
  2. Upload it to the same repository
  3. Make sure this line is in your <head>:
<link rel="icon" href="favicon.ico" /> 
Enter fullscreen mode Exit fullscreen mode

Done! Your site now has a personal touch.


๐ŸŒ Step 4: Go Live with GitHub Pages

Now the magic part.

  1. Go to the Settings tab of your repository
  2. Scroll down to "Pages" in the sidebar (or search for it)
  3. Under "Deploy from a branch", choose:
  • Source: main or master
  • Folder: / (root)
    1. Click Save

Within 30โ€“60 seconds, your website will be live at:

https://yourusername.github.io/ 
Enter fullscreen mode Exit fullscreen mode

๐ŸŽ‰ Congrats, youโ€™re live!


๐Ÿง  Tips

  • Your homepage should always be named index.html
  • You can create more pages (e.g. about.html, projects.html) and link them
  • For a more professional look, add CSS styles or use a static site generator (like Jekyll or Hugo)

๐Ÿ’ฌ Final Thoughts

GitHub Pages is perfect for:

  • Personal portfolios
  • Documentation sites
  • Project demos
  • Student assignments
  • Web experiments

And the best part? Itโ€™s free and super lightweight.

Have you published your own page yet? Drop a link in the comments โ€” Iโ€™d love to see it! ๐Ÿ‘‡


๐Ÿ“Œ Follow me for more web dev tips, GitHub tricks, and DIY web projects!


Top comments (0)