Close Menu
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    KahawatunguKahawatungu
    Button
    • NEWS
    • BUSINESS
    • KNOW YOUR CELEBRITY
    • POLITICS
    • TECHNOLOGY
    • SPORTS
    • HOW-TO
    • WORLD NEWS
    KahawatunguKahawatungu
    HOW-TO

    How to Host a Website on GitHub for Free with Custom Domain

    Damaris GatwiriBy Damaris GatwiriNovember 15, 2023No Comments2 Mins Read
    Facebook Twitter WhatsApp Telegram Email
    Share
    Facebook Twitter WhatsApp Telegram Pinterest Email Copy Link

    In today’s digital age, hosting your website on GitHub with a custom domain is not only cost-effective but also provides a professional touch. Follow these step-by-step instructions on How to host a website on GitHub for free with custom domain.

    1. Table of Contents

      Toggle
      • Create a GitHub Account
      • 2. Create a New Repository
      • 3. Add Your Website Files
      • Enable GitHub Pages
      • Choose a Custom Domain
      • Configure DNS Settings
      • Set Up a CNAME Record
      • Wait for DNS Propagation
      • Secure with HTTPS
      • Test Your Custom Domain

      Create a GitHub Account

    • Sign Up: If you don’t have a GitHub account, create one at GitHub.com.

    2. Create a New Repository

    • Repository Setup: Click on the ‘+’ in the upper right corner and select ‘New repository.’ Name it using the format <username>.github.io (replace <username> with your GitHub username).

    3. Add Your Website Files

    • Upload Content: Upload your website files to the repository. Ensure you include an ‘index.html’ file as GitHub Pages will use it as the main page.
    1. Enable GitHub Pages

    • Settings: In your repository, navigate to the ‘Settings’ tab. Scroll down to the ‘GitHub Pages’ section, select the ‘main’ branch, and click ‘Save.’
    1. Choose a Custom Domain

    • Purchase a Domain: Purchase a domain from a registrar like Namecheap or GoDaddy.
    1. Configure DNS Settings

    • Domain Settings: In your domain registrar account, locate DNS or Domain Management settings. Add a new ‘A’ record with the value 185.199.108.153 and three additional A records with the values 185.199.109.153, 185.199.110.153, and 185.199.111.153.
    1. Set Up a CNAME Record

    • www Subdomain: Add a CNAME record with the name ‘www’ pointing to <username>.github.io (replace <username> with your GitHub username).
    1. Wait for DNS Propagation

    • Patience is Key: DNS changes may take some time to propagate. Be patient and periodically check your custom domain to see if it’s live.
    1. Secure with HTTPS

    • Enforce HTTPS: Once your domain is live, return to the ‘Settings’ tab in your GitHub repository. Under ‘GitHub Pages,’ select ‘Enforce HTTPS.’
    1. Test Your Custom Domain

    • Visit Your Website: Open your web browser and enter your custom domain (e.g., yourdomain.com). Your website should now be live with the custom domain.

    Congratulations! Your website is now hosted on GitHub with a custom domain for free. Remember to update your GitHub repository whenever you make changes to your website content. Enjoy showcasing your digital presence to the world!

    Also Read: Navigating the Blue Tick: A Guide on How to Get Verified on Instagram

    Email your news TIPS to Editor@Kahawatungu.com — this is our only official communication channel

    Follow on Facebook Follow on X (Twitter)
    Share. Facebook Twitter WhatsApp LinkedIn Telegram Email
    Damaris Gatwiri

    Damaris Gatwiri is a digital journalist, driven by a profound passion for technology, health, and fashion.

    Related Posts

    How To Draw A Pencil

    December 12, 2025

    How To Draw A Palm Tree

    December 12, 2025

    How To Draw A Map For A School Project

    December 12, 2025

    Comments are closed.

    Latest Posts

    Eritrea Officially Withdraws from IGAD

    December 12, 2025

    Former IEBC Chair Chebukati’s Wife Mary Wanyonyi Awarded Top State Honour

    December 12, 2025

    AG Dorcas Oduor, CSs Kabogo, Kinyanjui and Barasa Awarded EGH

    December 12, 2025

    Duale reassures public on integrity of health data agreement with U.S.

    December 12, 2025

    Govt to Overhaul JKIA–ABC Road Corridor

    December 12, 2025

    Ruto Announces Plan for New 60km Nairobi–Thika Expressway

    December 12, 2025

    Ruto Approves Plan to Rename Talanta Stadium After Raila Odinga

    December 12, 2025

    King Charles III Sends Warm Jamhuri Day Message, Lauds Strong Partnership with President Ruto

    December 12, 2025
    Facebook X (Twitter) Instagram Pinterest
    © 2025 Kahawatungu.com. Designed by Okii.

    Type above and press Enter to search. Press Esc to cancel.