How to Host a Website on GitHub Pages Free (Custom Domain Setup Included)
How to Host a Website on GitHub for Free
Introduction to Hosting on GitHub
- Alex introduces the tutorial on hosting a website using GitHub Pages, emphasizing that it can be done for free with a custom domain.
- Viewers are instructed to create a GitHub account at github.com if they do not already have one.
Creating a Repository
- After logging in, users can create a new repository by selecting "Create" and naming it (e.g., "website demo").
- Users can upload files directly through the browser by dragging them into the repository; Alex mentions using an HTML template called "spectral" from HTML5 up.net.
Uploading Files
- Alternative sources for free templates are provided, including templatesjungle.com and techex's GitHub IO 100 template bundle.
- Users can upload up to 100 files via the browser; for more than 100 files, it's recommended to use the GitHub Desktop application.
Configuring GitHub Pages
- After uploading files, users need to commit changes and navigate to settings under "Pages" to configure their site.
- The default workflow is used for deploying static content; users should check the actions tab for deployment progress.
Setting Up Custom Domain
- Instructions are given on how to set up a custom domain under settings and pages; Alex uses his domain "ideas spot site" as an example.
- Important IP addresses must be added in the DNS manager of the domain registrar (e.g., Namecheap), where A records will point to these addresses.
Finalizing Domain Configuration
- Users should also add CNAME records pointing www subdomains back to their main domain name.
- DNS changes may take time; checking progress can be done at dnshcheck.org.
Ensuring Security and Completion
- Once DNS checks are successful, users should ensure HTTPS enforcement is enabled for security purposes.
- The tutorial concludes with confirmation that the website is live at its custom domain, showcasing free hosting capabilities with an HTML template.
Additional Resources