Hosting Deploy - Make Your Website Live
Your Docusar project is a static site built with Docusaurus. To make it live on the internet, you need to deploy it to a hosting provider. In this guide, you will learn how to deploy from zero - from registration to a live site.
Docusar works perfectly with three modern free hosting providers: Vercel, Netlify, and Cloudflare Pages.
Prerequisites
Before you start, make sure you have:
- Your Docusar project already pushed to GitHub (see the previous article: GitHub Push)
- A GitHub account
- A Gmail or email for registration
Step 1: Register on a Hosting Provider
You only need one provider. Pick one. Vercel is the easiest and fastest for Docusaurus.
Option A - Register on Vercel (Recommended)
- Go to https://vercel.com
- Click Sign Up on the top right
- Click Continue with GitHub - This is important. Do not use email. Use GitHub so your repo auto-connects.
- GitHub will ask you to authorize Vercel. Click Authorize Vercel
- You will be redirected to the Vercel dashboard. Registration done.
Option B - Register on Netlify
- Go to https://netlify.com
- Click Sign up
- Click Sign up with GitHub
- Authorize Netlify to access your GitHub
- You will enter the Netlify dashboard.
Option C - Register on Cloudflare Pages
- Go to https://pages.cloudflare.com
- Click Sign up for free or Log in
- Create an account with your email
- After login, go to Workers & Pages > Create application > Pages
- Click Connect to Git and connect your GitHub account
Step 2: Create a New Project
After you register and log in to the dashboard:
On Vercel:
- In the dashboard, click Add New... > Project
- You will see a list of your GitHub repositories. Find your Docusar repo.
- Click Import next to your repo name
- If you do not see your repo, click Adjust GitHub App Permissions and give Vercel access to all repos
On Netlify:
- In the dashboard, click Add new site > Import an existing project
- Click Deploy with GitHub
- Select your Docusar repository from the list
On Cloudflare Pages:
- Click Create a project > Connect to Git
- Select your GitHub account and your Docusar repository
- Click Begin setup
Step 3: Configure Build Settings
This is the most important part. The hosting needs to know how to build Docusaurus.
The system usually auto-detects, but check these settings:
- Framework Preset: Select
Docusaurus - Build Command:
npm run buildoryarn build - Output Directory:
build - Install Command:
npm installoryarn install - Root Directory: Leave empty (or
./if required)
Important: Do NOT change the Output Directory to public or dist. Docusaurus output is always build.
Leave Environment Variables empty unless you use a custom API.
Step 4: Deploy
- Click the Deploy button
- The hosting will start building your site. You will see build logs
- Wait 1-3 minutes. The process includes: installing packages > building Docusaurus > uploading files
- If the build is successful, you will see Congratulations and a live URL
Your live URLs will be:
- Vercel:
https://your-project-name.vercel.app - Netlify:
https://your-project-name.netlify.app - Cloudflare:
https://your-project-name.pages.dev
Click the URL to open your live website. Your Docusar site is now live.
Step 5: Auto Deploy and Custom Domain
Auto Deploy:
From now on, you do not need to deploy manually. Every time you push new changes to GitHub using git push, Vercel / Netlify / Cloudflare will auto-detect and auto-deploy your new version in 1-2 minutes.
How to Add a Custom Domain:
If you have your own domain like mydocs.com:
- On Vercel: Go to Project > Settings > Domains > Add your domain > Follow the DNS instructions
- On Netlify: Go to Domain settings > Add custom domain
- On Cloudflare: Go to the Custom domains tab > Set up a custom domain
Update your domain DNS with the provided CNAME or A record. Your site will be live on your custom domain within 5-30 minutes.
If the build fails, check the build logs for errors. The most common error is a missing build folder or a wrong build command.