Skip to main content

Free Website Hosting for Life: A Comprehensive Guide to GitHub Pages and Render

Β· 6 min read
gl0bal01
Chief of the v0id

In an era where web hosting typically costs $10-30 per month, it may seem impossible to host a professional website for free. However, with the rise of JAMstack architecture and static site generators, completely free, production-ready hosting is not only possible but increasingly popular among developers and organizations worldwide.

This guide provides a comprehensive comparison of the two leading free static hosting platformsβ€”GitHub Pages and Renderβ€”along with detailed setup instructions and domain configuration.

Understanding JAMstack Architecture​

JAMstack represents a modern web development architecture based on client-side JavaScript, reusable APIs, and prebuilt Markup. This approach fundamentally differs from traditional server-side architectures.

Core Principles​

Traditional Architecture:
  • Server processes requests dynamically
  • Database queries on each page load
  • Higher hosting costs due to compute resources
  • Potential security vulnerabilities
JAMstack Architecture:
  • Pre-built static files
  • Content served directly from CDN
  • Minimal server resources required
  • Enhanced security through reduced attack surface

Why JAMstack Enables Free Hosting​

Static file hosting requires significantly fewer resources than dynamic server hosting:
  1. No compute costs: Files are served as-is without processing
  2. Efficient caching: CDNs can cache content globally
  3. Predictable bandwidth: Easier for providers to manage costs
  4. Lower infrastructure requirements: No databases or application servers

Platform Comparison: GitHub Pages vs Render​

Both platforms offer robust free tiers suitable for production websites.

Resource Limits and Quotas​

FeatureGitHub PagesRender
Monthly Bandwidth100 GB (soft limit)100 GB
Storage Limit1 GBUnlimited
Build Minutes2,000/month400 hours/month
Sites AllowedUnlimitedUnlimited
Concurrent Builds1Multiple
Build Timeout10 minutesUnlimited

Technical Specifications​

SpecificationGitHub PagesRender
CDN ProviderFastlyCloudflare
HTTP VersionHTTP/2HTTP/3
CompressionGzipBrotli + Gzip
SSL CertificateLet's EncryptLet's Encrypt
IPv6 SupportYesYes
Custom HeadersNoYes
RedirectsLimited (via plugin)Native support

Performance Metrics​

MetricGitHub PagesRender
Average TTFB180ms120ms
Global Locations5200+
Uptime SLA99.95%99.95%
DDoS ProtectionBasicAdvanced (Cloudflare)

Feature Comparison​

FeatureGitHub PagesRender
Preview DeploymentsNoYes (automatic for PRs)
Rollback CapabilityManual (Git-based)One-click rollback
Build LogsVia ActionsReal-time detailed logs
Environment VariablesVia SecretsNative support
Deployment MethodGitHub ActionsAutomatic on push
API for DeploymentsGitHub APIRender API
Team CollaborationGitHub permissionsBuilt-in team features

Setting Up GitHub Pages​

Prerequisites​

  • GitHub account
  • Git installed locally
  • Node.js 18+ (for Docusaurus)

Create Your Static Site​

For this example, we'll use Docusaurus, a popular static site generator:

npx create-docusaurus@latest my-website classic --typescript
cd my-website
npm run build

Initialize Git Repository​

git init
git add .
git commit -m "Initial commit"

Create GitHub Repository​

  1. Navigate to github.com/new
  2. Create a new repository (do not initialize with README)
  3. Follow the instructions to push existing repository
git remote add origin https://github.com/USERNAME/REPOSITORY.git
git branch -M main
git push -u origin main

Configure GitHub Actions Workflow​

Create .github/workflows/deploy.yml:

name: Deploy to GitHub Pages

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install and Build
run: |
npm install
npm run build

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: build

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

Enable GitHub Pages​

  1. Navigate to Settings β†’ Pages in your repository
  2. Source: Select "GitHub Actions"
  3. Wait for the first deployment to complete

Your site will be available at: https://USERNAME.github.io/REPOSITORY/

Setting Up Render​

Create Render Account​

  1. Visit render.com
  2. Sign up (preferably with GitHub for easier integration)

Deploy Static Site​

  1. Click "New +" β†’ "Static Site"
  2. Connect your GitHub repository
  3. Configure build settings:
    • Build Command: npm install && npm run build
    • Publish Directory: build
  4. Click "Create Static Site"

Custom Domain Configuration​

Domain Registration​

First, register a domain with any registrar (Namecheap, GoDaddy, Cloudflare, etc.). Costs typically range from $10-15 per year for common TLDs.

GitHub Pages Domain Setup​

Add CNAME File​

Create static/CNAME (for Docusaurus) or CNAME in root:

yourdomain.com

Configure DNS Records​

At your domain registrar, add these records:

For apex domain (yourdomain.com):

Type: A
Name: @
Value: 185.199.108.153

Type: A
Name: @
Value: 185.199.109.153

Type: A
Name: @
Value: 185.199.110.153

Type: A
Name: @
Value: 185.199.111.153

For www subdomain:

Type: CNAME
Name: www
Value: USERNAME.github.io

Enable HTTPS​

  1. Go to repository Settings β†’ Pages
  2. Add your custom domain
  3. Check "Enforce HTTPS" (may take up to 24 hours to be available)

Render Domain Setup​

Add Custom Domain​

  1. In Render dashboard, go to Settings
  2. Scroll to "Custom Domains"
  3. Add your domain

Configure DNS​

Render will provide specific DNS records. Typically:

For apex domain:

Type: A
Name: @
Value: [Provided by Render]

For CNAME (if ALIAS not available):

Type: CNAME
Name: www
Value: your-site.onrender.com

SSL Certificate​

Render automatically provisions and renews SSL certificates via Let's Encrypt.

Decision Framework​

Choose GitHub Pages if:
  • Your code is already on GitHub
  • You prefer maximum simplicity
  • You don't need preview deployments
  • Basic hosting features are sufficient
  • You want everything in one platform
Choose Render if:
  • You need preview deployments for pull requests
  • Advanced features like redirects and headers are required
  • Performance is critical (HTTP/3, Brotli)
  • You work in a team environment
  • You need rollback capabilities

The era of expensive web hosting is over for static sites. With proper implementation of JAMstack principles and these free hosting platforms, you can maintain a professional web presence without ongoing hosting costs.

Additional Resources​