You’re building your portfolio in Nairobi or starting a side-hustle blog, but hosting feels tricky.
Some cheap options hide fees. Others are slow, or setup takes forever.
What if you could get your site online for free, in under an hour, without touching your credit card?
That’s what web hosting GitHub offers. It’s not a fancy paid host. GitHub takes your files and turns them into a live website that loads fast and stays secure.
No servers to manage, no complicated setup: just your site ready for the world, or your next client, to see.
If you’re just starting out in Kenya’s digital scene or tired of expensive hosting, this guide is your shortcut.
Step by step, we’ll show you how to host your static site, portfolios, landing pages, or documentation on GitHub.
Later, when your site grows or needs more power, you can move to Truehost’s hosting plans, optimized for Kenya with M-PESA support and local servers.
By the end of this guide, your website will be live, fast, and secure. No fluff, no long delays, just results. Here’s what we’ll cover:
- What GitHub Pages is and why it matters
- How to set up your first repository
- Uploading your website files the easy way
- Making your site live with a custom domain
- Tips, best practices, and troubleshooting
Let’s jump straight to it and get your website online.
What is GitHub Pages?
GitHub is like a massive community library where developers store their work.
It is the display window at the front, showing your website to anyone walking by.
You just place your files in the right spot, and GitHub presents them to the world.
Since 2008, it has become a reliable way to host websites quickly.
You upload HTML, CSS, and JavaScript files to a repository, and GitHub serves them instantly.
No databases, no backend headaches, just fast, clean static content.
For Kenyan creators and startups, it’s a huge advantage. Data costs can be high, and budgets are tight.
GitHub Pages gives free hosting for public repositories, automatic HTTPS for security, and tracks every change you make, so you can see your site grow step by step.
It works even if you’re a beginner. If you’ve ever built a simple HTML page, you’re ready.
And when your project outgrows a static site, like adding e-commerce features, Truehost hosting offers a smooth upgrade with local servers and M-PESA support.
Key Features of GitHub Pages
GitHub Pages packs tools that make hosting simple and powerful:

- Free Forever: Public repositories cost nothing; private ones require a paid plan.
- Custom Domains: Use your own .ke or .com domain instead of the default github.io.
- Automatic HTTPS: Visitors’ data is safe right from the start.
- Optional Jekyll Support: Convert Markdown into blog posts easily.
- Automation with GitHub Actions: Automatically rebuild and deploy your site when you update files.
Here’s how GitHub Pages stacks up against traditional shared hosting:
| Feature | GitHub Pages | Shared Hosting (Truehost) |
| Cost | Free for static sites | Starts low, grows with traffic |
| Setup Time | Minutes | Hours with control panels |
| Best For | Portfolios, docs | Dynamic sites, databases |
GitHub Pages wins for simplicity and speed. For portfolios, personal projects, or small business sites, it’s ideal.
For bigger traffic or advanced features in Kenya, Truehost gives local support and extra reliability.
Real-Life Use Cases in Kenya
Web hosting on GitHub Pages fits small projects perfectly. A freelance designer in Mombasa can showcase work online.
A teacher in Kisumu can share lesson plans. One push, and updates are live instantly.

Ken is a web developer and graphic designer based in Nairobi. He used to rely on slow, clunky paid hosting that made his portfolio frustrating to show.
When he moved everything to GitHub Pages, his site became lightning-fast and free to host.
His portfolio featuring Flutter apps, React projects, and AI chatbots quickly caught the attention of startups worldwide.
A simple inquiry from a U.S. health-tech firm turned into long-term partnerships.
Repeat clients across industries helped him grow into one of Kenya’s top-ranked developers in 2024. That first multi-project deal funded his shift to full-time freelancing.
Over 10 million sites run on GitHub Pages globally. In Kenya, it fuels side hustles without draining cash.
You get free hosting, fast loads, and HTTPS security without complicated setup.
It works best for static sites. That means:
- Portfolios and resumes
- Landing pages for side hustles
- Documentation for projects
- Simple blogs
If your project needs databases, online stores, or heavy traffic, GitHub Pages can hand off to Truehost hosting smoothly.
Local servers, M-PESA payment options, and 24/7 support make scaling simple.
Prerequisites
Before you host your site on GitHub Pages, you need a few basics.

No computer science degree required just simple tools and a little preparation.
- GitHub Account
Sign up for free at github.com. Use your email and verify it takes seconds. This is where your website files will live. - Basic HTML, CSS, and JavaScript
You don’t need to be an expert. Even one simple HTML page is enough to get started. FreeCodeCamp offers short tutorials you can complete at your own pace. - Git Installed
Download Git from git-scm.com. Git is the bridge between your computer and GitHub. It keeps track of changes and helps you update your site easily. - VS Code or Another Code Editor
VS Code is free, intuitive, and perfect for beginners. You’ll use it to edit your HTML, CSS, and JS files before uploading. - Your Static Website Files Ready
Start simple. Create a file called index.html for your homepage. Here’s an example:
<!DOCTYPE html>
<html>
<head>
<title>My First Site</title>
</head>
<body>
<h1>Hello, Kenya!</h1>
<p>Web hosting on GitHub is live and fast.</p>
</body>
</html>
- Stable Internet Connection
In Kenya, WiFi can be patchy. A steady connection makes uploading files smoother. If your connection drops, Truehost hosting offers local backups and fast recovery.
Once you have these ready, you’re set to create your repository and upload your site. It’s simple and takes just a few minutes.
Step-by-Step Guide to Host a Static Website on GitHub
Let’s get your site online. Follow these steps carefully, and your static website will be live fast.
Step 1: Create a New GitHub Repository
- Log in to GitHub.
- Click the “+” icon on the top-right and select “New repository.”
- Name it something simple, like my-kenya-portfolio. If it’s your personal site, use yourusername.github.io. This becomes your homepage URL.
- Make it public. Public repos are free and required for GitHub Pages hosting.
- Check “Add a README file” for a quick starter.
- Click “Create repository.”
This repository is your website’s foundation. Keep it public unless you’re ready to pay for private hosting.
Step 2: Add Your Website Files
You have two options:
Option A: Upload via GitHub Web Interface
- Open your repository and click “Add file” then “Upload files.”
- Drag and drop your index.html, styles.css, and any images.
- Commit your changes with a message like “Initial upload.”
This method is simple, like sending an email attachment.
Option B: Use Git Command Line (Advanced)
For those comfortable with terminal:
git clone https://github.com/yourusername/my-kenya-portfolio.git
cd my-kenya-portfolio
git add .
git commit -m “Added static site files”
git push origin main
Using Git keeps a history of every change. Perfect if you plan to update your site often.
Step 3: Enable GitHub Pages
- Go to your repository then Settings then Pages.

- Under Source, select main branch and the root folder.
- Click Save.
- Wait 1–10 minutes for GitHub to process your site.
- Your live URL will be
https://yourusername.github.io/my-kenya-portfolio.
If you see a 404 page, double-check the branch and folder settings, or give it a few minutes.
Step 4 (Optional): Use a Custom Domain
If you have a domain from Truehost:
- Go to Pages Settings then Custom domain.
- Enter your domain, for example,
www.yourdomain.ke. - Update DNS at your registrar:
- A record: Point @ to GitHub’s IPs (185.199.108.153, etc.)
- CNAME: Point www to yourusername.github.io
- A record: Point @ to GitHub’s IPs (185.199.108.153, etc.)
DNS propagation may take 1 to 48 hours. HTTPS is automatic, so your site is secure.
Step 5: Test and Go Live
- Open your site in a browser and on mobile. Make sure everything loads correctly.
- Check speed with Google PageSpeed Insights.
- Add Google Analytics if you want to track visitors.
- Share your link on WhatsApp, LinkedIn, or social media. Celebrate your first live website!
Once this is done, your static site is live, fast, and secure. GitHub Pages takes care of hosting while you focus on updating your content.
Best Practices and Troubleshooting
Getting your site live is just the start. Follow these best practices to keep it smooth and professional.

Best Practices
- Start with the Root index.html
This is your website’s welcome mat. GitHub Pages looks for this file first. - Use Clean Filenames
Stick to lowercase letters and no spaces. For example, my-portfolio.html instead of My Portfolio.HTML. Clean URLs make sharing easy. - Commit Often
Every change should have a message like “Fixed navbar bug” or “Updated portfolio image.” GitHub tracks your site like a time machine. - Handle Jekyll Carefully
Jekyll can ignore some folders, like _posts. Add a .nojekyll file in the root to prevent this. - SEO and Accessibility
Include meta tags with keywords like “web hosting GitHub.” Add alt text to images so search engines and screen readers understand them. - Security
Keep sensitive info out of your code. HTTPS is automatic, so visitor data stays safe.
Troubleshooting Common Issues
- 404 Errors
Check that your index.html is in the root folder and the correct branch is selected in settings. - Build Errors
HTML typos can break your site. Use validator.w3.org to check your code. - Custom Domain Problems
DNS changes can take 1–48 hours to propagate. Tools like whatsmydns.net can help you track progress. - Slow Load in Kenya
Compress images using TinyPNG or other tools. GitHub Pages uses a global CDN, but optimized assets speed things up locally. - Offline Pushes
If your internet drops, Git queues your changes. Once you’re back online, Git syncs automatically. - Need Help?
GitHub Community forums are full of answers for any issue. You’re never stuck alone.
Following these steps ensures your site stays professional, fast, and secure. Small habits like proper filenames and frequent commits save headaches later.
Advanced Topics and When to Scale

Here’s when and how to take it to the next level.
Automate with GitHub Actions
If you update your website often, GitHub Actions can save time.
It automatically rebuilds and deploys your site every time you push changes.
No manual uploads. You can focus on content while GitHub keeps your site live and updated.
Know the Limits
GitHub Pages works best for static content:
- Portfolios and resumes
- Simple blogs
- Landing pages
- Documentation
It doesn’t support dynamic features like online stores, databases, or server-side scripts. For those, you need a full hosting service.
When to Move to Truehost Hosting
If your website grows and starts getting heavy traffic in Kenya, or if you want features like:
- Databases for apps or e-commerce
- Email hosting
- Local servers for faster Kenyan access
…then Truehost hosting is the natural next step. Migrating is easy: zip your GitHub repo, upload it to Truehost’s cPanel, and you’re live with added power and local support.
Benefits of Scaling
Moving from GitHub Pages to Truehost gives you:
- Local Speed: Servers in Kenya reduce load time for local visitors.
- Payment Options: M-PESA makes payments and subscriptions easier for your audience.
- 24/7 Support: Local support means faster help when you need it.
- More Control: Run databases, dynamic apps, and advanced features your site might need.
GitHub Pages is the launchpad. Truehost hosting is the runway for bigger, more complex projects. Start small, stay free, and scale when the time is right.
Conclusion
Your static website is now live on GitHub, fast, free, and secure. From creating a repository to uploading files and going live, you handled it all. That’s a big win.
GitHub Pages is ideal for portfolios, landing pages, and side projects. You can update your site anytime, track changes, and share it with clients or friends.
For small projects or side hustles in Kenya, it’s a zero-cost, high-speed solution.
When your site grows or needs more features, scaling to Truehost hosting is simple.
You’ll get local servers, M-PESA support, and tools for databases or dynamic apps. Start small, learn the ropes, and expand when ready.
Domain SearchInstantly check and register your preferred domain name
Web Hosting
cPanel HostingHosting powered by cPanel (Most user friendly)
KE Domains
Reseller HostingStart your own hosting business without tech hustles
Windows HostingOptimized for Windows-based applications and sites.
Free Domain
Affiliate ProgramEarn commissions by referring customers to our platforms
Free HostingTest our SSD Hosting for free, for life (1GB storage)
Domain TransferMove your domain to us with zero downtime and full control
All DomainsBrowse and register domain extensions from around the world
.Com Domain
WhoisLook up domain ownership, expiry dates, and registrar information
VPS Hosting
Managed VPSNon techy? Opt for fully managed VPS server
Dedicated ServersEnjoy unmatched power and control with your own physical server.
SupportOur support guides cover everything you need to know about our services








