The Cheapest Way to Host Docs From a GitHub Repo With a Custom Domain
The cheapest way to host docs from a GitHub repo with a custom domain is GitHub Pages with a static site generator such as Docusaurus or Starlight. It costs $0 for public repositories and includes HTTPS on your domain. You pay with your time: you own the build workflow, search, upgrades, and llms.txt. If you would rather not run a build, several hosted platforms also include a custom domain on their free plan. Docs7 Free, Mintlify Starter, Fern, and ReadMe Starter all do.
Both paths start from the same thing: Markdown or MDX files in your repository, built on every push to the default branch.
We build Docs7, so weigh this guide with that in mind. Free plans change, so check each vendor's pricing page before you commit. Plans are as of October 20, 2026.
Free Options Compared
A private repository changes the answer. GitHub Pages from a private repository needs a paid GitHub plan, and Docs7 Free hosts public repositories only. Docs7 Pro, at $200 a month, adds private repositories.
Option 1: GitHub Pages and a Static Site Generator
Best for: Projects that want full control and a $0 bill
GitHub Pages serves static files. A generator such as Docusaurus, Starlight, VitePress, or MkDocs turns your Markdown into those files, and a GitHub Actions workflow builds and publishes them on each push.
- Create the site with your generator, for example
npm create astro@latest -- --template starlightfor Starlight ornpx create-docusaurus@latest docs classicfor Docusaurus. - In the repository, open Settings → Pages and set the source to GitHub Actions.
- Add a workflow that builds the site and publishes the output folder with the
actions/upload-pages-artifactandactions/deploy-pagesactions. Docusaurus and Starlight both document a ready workflow. - In Settings → Pages, enter your custom domain, such as
docs.example.com. - At your DNS provider, add a
CNAMErecord fromdocsto<your-user-or-org>.github.io. For a root domain such asexample.com, addArecords to185.199.108.153,185.199.109.153,185.199.110.153, and185.199.111.153. - When the DNS check passes, turn on Enforce HTTPS.
Verify the domain in your GitHub account or organization settings too, so that no other GitHub Pages site can take it over.
What you give up: no pull request previews unless you build them, search is a plugin or an Algolia DocSearch application on Docusaurus (Starlight includes search), and llms.txt for AI agents needs a community plugin. Each framework upgrade is yours to do.
Option 2: A Hosted Platform's Free Plan
Best for: Small teams that want to write docs, not run a build
A hosted platform connects to your repository, builds on each push, and serves the site on your domain. You add DNS records once.
Docs7 Free
Best for: MDX docs in GitHub that coding agents also read
Website: context7.com/docs7 · Price: Free for up to three sites from public GitHub repos; Pro $200 a month with three sites included
Docs7 builds Mintlify-format projects (docs.json or mint.json with MDX pages) from a public GitHub repository and hosts up to three sites for $0. The free plan includes a custom domain, or a path on your existing website such as example.com/docs, plus pull request previews, search, an API playground, llms.txt, and analytics that show which AI providers read your pages. Each production deploy can refresh your library on Context7, so coding agents get your current docs. Free sites show a Docs7 attribution in the footer. It has no web editor and connects to GitHub only.
To set up the domain, open the site's Settings, add docs.example.com in the Domain card, and add the CNAME and TXT records it shows. Docs7 issues the HTTPS certificate.
Mintlify Starter
Best for: Teams that also want a web editor
Mintlify's free Starter plan builds docs.json projects from GitHub and includes a custom domain, an automatic llms.txt, and an MCP server. Analytics, preview deployments, and the AI assistant are on paid plans.
Fern Free
Best for: API docs generated from an OpenAPI file
Fern's free plan hosts one docs site on a custom domain or subpath. You publish from CI with the Fern CLI, so you add one workflow step.
ReadMe Starter
Best for: API-first products where readers start in the reference
ReadMe's free Starter plan includes an interactive API reference, a custom domain, llms.txt, and an MCP server. Inviting teammates needs a paid plan.
Which One Should You Pick?
The bill is not the only cost. A $0 static site that someone has to rebuild, upgrade, and fix costs more than a hosted free plan for most small teams. A hosted plan costs you some control: the theme, the components, and the limits are the vendor's.
Make the Docs Readable by AI Agents
Many readers now ask Claude Code, Cursor, or Codex about your library before they open your docs. Those agents read llms.txt, Markdown pages, and indexes such as Context7 more reliably than rendered HTML.
On GitHub Pages, add an llms.txt plugin for your generator and add your repository to Context7 at context7.com/add-library. On Docs7, both are built in: tick Add to Context7 when you connect the repository, and every production deploy refreshes the library.
- Docs platforms that generate
llms.txt: Which documentation platforms make your docs readable by AI agents and LLMs. - Best documentation platform for open source: Docusaurus, Starlight, Read the Docs, VitePress, and hosted free plans for open-source projects.
Frequently asked questions
What's the cheapest way to host docs from a GitHub repo with a custom domain?
GitHub Pages with a static site generator such as Docusaurus or Starlight. It is free for public repositories and serves your custom domain with HTTPS, but you maintain the build workflow yourself. Docs7 Free, Mintlify Starter, Fern's free plan, and ReadMe Starter also include a custom domain at no cost and run the build for you.
Can I use a custom domain with GitHub Pages for free?
Yes. Enter the domain in the repository's Settings → Pages, then add a CNAME record to <user>.github.io for a subdomain, or A records to GitHub's four Pages IP addresses for a root domain. After the DNS check passes, turn on Enforce HTTPS. Pages from a private repository needs a paid GitHub plan.
Which hosted docs platforms include a custom domain on the free plan?
As of October 2026, Docs7 Free, Mintlify Starter, Fern's free plan, and ReadMe Starter. GitBook's Free plan does not, but its sponsored plan for approved open-source projects does, with an ad on each page. Free plans change, so check the pricing page before you start.
Can I host docs at a path such as example.com/docs instead of a subdomain?
Yes, with a reverse proxy on your main site. Docs7 Free supports a path on your existing website and gives the proxy rules for Cloudflare, Vercel, and other hosts. Fern also supports a subpath. On GitHub Pages, a path needs your main site to be on Pages too, or a proxy.
Do I need a build step to host docs from GitHub?
On GitHub Pages, yes, unless you write plain HTML: a workflow runs the generator and publishes the output. Hosted platforms such as Docs7, Mintlify, and ReadMe run the build for you on each push. Fern needs one CLI step in your CI.
Host Your Docs From GitHub on Your Own Domain
Connect a public GitHub repository with a docs.json or mint.json, and Docs7 Free builds it on every push, serves it on your custom domain, and keeps it current in Context7 for coding agents.