📘 Introduction

Welcome to this hands-on Docusaurus deployment tutorial! In this guide, we’ll walk you step-by-step through deploying your Docusaurus site to GitHub Pages — a simple and free hosting solution for websites. Perfect for open-source projects, documentation sites, or personal projects that you want to share with the world.

💡 What is GitHub Pages?

GitHub Pages is a free hosting service provided by GitHub that lets you publish static websites directly from your GitHub repositories.

It’s often used for:

🌐 Hosting project documentation
📖 Publishing personal blogs or portfolios
🚀 Sharing demos of open-source projects

With GitHub Pages, your site is:

✅ Free to host with your GitHub account
✅ Backed by Git’s version control, so every change is tracked
✅ Easy to integrate with static site generators like Docusaurus

💡
By the end of this tutorial, your documentation site will be live on the web using GitHub Pages.

✅ Prerequisites

Before starting, make sure you have the following:

📂☑️ A Docusaurus project created
🌐☑️ A GitHub account
🔧☑️ Git installed
📦☑️ npm installed

📤1️⃣ Push Your Project to GitHub

First, create a new repository on GitHub (e.g., my-docs). Then, push your local Docusaurus project:

git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/<YOUR_USERNAME>/my-docs.git
git push -u origin main

📝2️⃣ Configure Docusaurus for GitHub Pages

Open the file docusaurus.config.js and set the following values:

You can view this post with the tier: Academy Membership

Join academy now to read the post and get access to the full library of premium posts for academy members only.

Join Academy Already have an account? Sign In