GitHub Pages
GitHub Pages hosts public static sites free with a 1 GB maximum published size and a soft 100 GB monthly bandwidth allowance; hosting an online business, e-commerce, or primarily commercial SaaS is prohibited.
GitHub Pages publishes a static website straight from a GitHub repository, on a github.io address or your own custom domain. It suits personal, project, and documentation sites.
Is it a fit?
Good fit
Use GitHub Pages for a static personal, project, or documentation site that lives in a public GitHub repository.
- personal sites
- project documentation
- open-source project sites
- simple blogs
Not a fit
Skip it for private sites on GitHub Free, for sites that need server-side code (the docs mention none), or for an online business or store, which GitHub says Pages must not be used for.
- you run a business or e-commerce site
- you need server-side code
- you need a private site on GitHub Free
You push files to a GitHub repository and turn on Pages in the repository settings. The quickstart builds a user site from a repository named after your username, and you can also publish with a GitHub Actions workflow. It suits developers who already keep their work on GitHub.
What the free plan gives you
GitHub Pages costs nothing on GitHub Free. It works with public repositories on GitHub Free and GitHub Free for organizations. Private repositories need a paid GitHub plan. A published site may be no larger than 1 GB, and the source repository has a recommended limit of 1 GB.
The docs list a soft bandwidth limit of 100 GB per month and a soft limit of 10 builds per hour. The build limit does not apply if you publish with a custom GitHub Actions workflow. Deployments time out after 10 minutes. You can create one user or organization site per account. Custom domains are supported, and GitHub has guides to configure and verify them.
When you hit a limit
Bandwidth and build-frequency limits are soft; the 1 GB published-site maximum and 10-minute deployment timeout are separate limits. The docs do not describe an overage charge. If your site exceeds the usage quotas, GitHub says it may not be able to serve your site, or you may get an email from GitHub Support with ways to reduce your load. The email may suggest a CDN in front of your site, other GitHub features such as releases, or a different host.
Rate limits may also apply for consistent quality of service. If a request triggers them, you receive an HTTP 429 response. The docs describe a degraded or unserved site and an email from GitHub Support, not a bill.
Gotchas
- GitHub says Pages must not be used as free hosting for an online business, an e-commerce site, or a site mainly for commercial transactions or SaaS.
- Sites should not be used for sensitive transactions such as sending passwords or credit card numbers.
- Changes can take up to 10 minutes to publish after you push them.
Alternatives in this atlas
- Cloudflare Pages: when your source repository is private, since Pages there supports private repositories.
- Netlify: when you want preview deploys and extra site features.
- Firebase Hosting: when your project already uses Firebase.
Questions people ask
Is GitHub Pages free?
Yes, for public repositories on GitHub Free. Published sites may be up to 1 GB, with soft limits of 100 GB of bandwidth per month and 10 builds per hour.
Can I use GitHub Pages for a business site?
No. The docs say Pages is not intended or allowed as free hosting to run an online business, an e-commerce site, or a mainly commercial SaaS site.
Can I use a custom domain with GitHub Pages?
Yes. GitHub documents how to configure, manage, and verify a custom domain for Pages.
How to get started
- Create a GitHub account if you do not have one.
- Create a new repository named username.github.io, replacing username with your GitHub username, and add a README.
- Open the repository Settings, then Pages, and under Build and deployment choose Deploy from a branch.
- Pick the branch and folder to publish from.
- Edit README.md or add files, then visit username.github.io; changes can take up to 10 minutes to publish.
- Optionally set a title and description in `_config.yml` and add a custom domain later.
Other free hosting options
Same category, safest first.