Static Webpage Hosting for Free (using GitHub Pages) on a custom domain
So my main project this year, StartupPilots, will require a lot of splash pages and I was trying to work out the best way to host these for as cheap as possible. After looking around I was really happy to find GitHub Pages, which as long as you’re ok with a static page, is perfect. So here is a quick rundown of how to get started and get your domain up and running in no time at all:
- If you haven’t already create an account on GitHub.com
- Create a new organisation (Click the +, select Organisation)
- Write a name for your organisation, select ‘Open Source’ (if you’re hosting a static page then people can grab this pretty easily anyway so no worries)
- Now create a repository in this new organisation, and make sure it is called youorganisation.github.io (very important).
- Now we need to upload your content to this repository, so follow the guide to uploading. Make sure you have an index.html file at the base level.
- Once you have pushed your files to your repository you’ll notice you can now access the index.html by going to: youorganisation.github.io in your browser.
- Now we need to setup your domain name, so buy your domain name as you normally would (GoDaddy.com, Google.com/domains), and go into the DNS settings
- Create an Alias (A) Record with the IP Address’ of: 192.30.252.154 & 192.30.252.153.
- Create a CNAME Record with www and youorganisation.github.io as the domain name
- Finally we need to set it up inside of your GitHub Page, so go back into your local repository, create a new file called ‘CNAME’ and just have one line with ‘yourdomain.com’ (No www, http…etc).
- Push this to your repository again
- Wait up to 10 minutes and then refresh and you should see whatever you had in your index.html
I’m currently using it for 3 StartupPilots websites:
http://www.decibelrecorder.com/
So enjoy! And hopefully by my next blog post StartupPilots.com will be live so make sure to check it out!