Creating a free website on GitHub pages

Creating a free website on GitHub

  1. Log in to GitHub https://github.com/login
  2. Create a new repository
    • Click the top-right + (plus) button
    • Or go to https://github.com/new
  3. Name the repository whatever you want, like
    • mywebsite or testing
  4. Create a file (or upload one you have)
    • Click the creating a new file link:
  5. Name the file index.html
  6. Add something to the file (like ‘Hello’)
  7. Click the green button Commit to Save the file (at the bottom)

Now we have created a file with some content in a repository.

Enabling GitHub pages

Next we need to tell GitHub we want this repository to be a website!

  1. Click the Settings tab for your repository
  2. Scroll down until you find the GitHub settings
    • Enable GitHub pages by clicking the None dropdown and selecting master branch (first option) *
  3. GitHub will now enable your page.
  4. Scroll down again so you can see the link to your website

Thats it! Congratulations on your very own website!

Next steps (optional)

  1. Learn HTML
    • https://www.w3schools.com/html/
    • https://www.codecademy.com/learn/learn-html
  2. Learn CSS
    • https://www.w3schools.com/css/
  3. Learn JavaScript

Using a custom domain (advanced)

In the GitHub Settings you can also add your own domain like mydomain.com

You need to have:

  1. Bought a domain!
  2. Pointed the DNS records to GitHub pages
    • https://help.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site
    • On the website you bought your domain:
    • Create an A record pointing to any of these IPs:
      • 185.199.108.153
      • 185.199.109.153
      • 185.199.110.153
      • 185.199.111.153

Posts