Hosting Your Custom Domain on GitHub

  • In your terminal(if you are using Mac) or command line/git bash (for Windows users) go to the folder you are are working in. Typically, you use the cd command.
  • Say your dream project is titled “dream-project”. In your terminal, type “cd dream-project”
  • Once you are in your project, you need to initialize it with git.
“man on running field” by Braden Collum on Unsplash
  • git init begins your project
  • add your changes with git add .
  • Commit your changes with git commit -m “Initial commit”. I always start out with “initial commit” just to get the ball rolling, but you can put whatever you want into that message.
  • Once you have committed your changes locally, you can now push your project to GitHub. Make sure you have an identical project name on GitHub to push these changes to. GitHub will give you directions on what to type into your command line to make the push live. (This is why it’s important to actually know how to use GitHub to begin with)
  • Purchase you custom domain name — GoDaddy is the big boss around town, but there are other options and I personally like using Namecheap. Check them out to compare prices.
  • Is your “dream-project” domain name available? Get it! Typically, you want to go with .com, but all the other myriads of extensions also work. At this point, it’s all about your personal preference, and your price range of course.
  • Now that you’ve purchased your domain name, head back to Github.
  • Go to the Settings of your Repo, and there will be a field asking for a custom domain. Enter your domain name there.
  • At this point, you will need to create a CNAME file. GitHub will actuallly tell you do this after you enter in your custom domain name. Go to your repo, title it CNAME(must be in all caps) and within the file itself, just type in the name of your domain name(
  • Go back to your domain host provider. You should now have an account with them to manage your domain names. Select what domain name you want to manage, and if you’re using NameCheap, select the Advanced DNS settings.
From NameCheap
  • Not only can you host your site on github for free with your custom url, github, you can also enable https on your site, just by checking the “Enforce HTTPS” box under the custom domain name! You don’t have to pay for an SSL certificate, and the process is so easy.




More at

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Writing Robust and Error-Free Python Code Using Pydantic

Start functions with style using Cookiecutter

Continuous Performance Testing with k6 and GitHub Actions

Virtual Background with Amazon Chime SDK & BodyPix

Week 10: Halfway through

The Ruby Unbundled Series: Creating Games with Gosu

Introduction To Linux Development

Introduction to Keptn

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jo-wayne Josephs

Jo-wayne Josephs

More at

More from Medium

Introduction To Git & GitHub

Multimodule Projects in Git Part2: Handling Subprojects Using Branching

What is NGINX & Why you should use it now?

Git:- Git is a distributed version control system for tracking changes in source code during…