With access control for GitHub Pages, you can restrict access to your GitHub Pages site by publishing the site privately. A privately published site can only be accessed by people with read access to the repository the site is published from. You can use privately published sites to share your internal documentation or knowledge base with members of your enterprise.
If your enterprise uses Enterprise Managed Users, all GitHub Pages sites are privately published. For more information about Enterprise Managed Users, see "About Enterprise Managed Users."
If your organization uses GitHub Enterprise Cloud without Enterprise Managed Users, you can choose to publish your sites privately or publicly to anyone on the internet. Access control is available for project sites that are published from a private or internal repository that are owned by the organization. You cannot manage access control for an organization site. For more information about the types of GitHub Pages sites, see "About GitHub Pages."
Privately published sites are available at a different subdomain than publicly published sites. This ensures that your GitHub Pages site is secure from the moment it's published:
- We automatically secure every subdomain of
*.pages.github.iowith a TLS certificate, and enforce HSTS to ensure that browsers always serve the page over HTTPS.
- We use a unique subdomain for the private page to ensure that other repositories in your organization cannot publish content on the same origin as the private page. This protects your private page from "cookie tossing". This is also why we don't host GitHub Pages sites on the
You can see your site's unique subdomain in the pages tab of your repository settings. If you're using a static site generator configured to build the site with the repository name as a path, you may need to update the settings for the static site generator when changing the site to private. For more information, see "Configuring Jekyll in your GitHub Pages site" or the documentation for your static site generator.
To use a shorter and more memorable domain for your private GitHub Pages site, you can configure a custom domain. For more information, see "Configuring a custom domain for your GitHub Pages site."
On GitHub, navigate to your site's repository.
Under your repository name, click Settings.
In the left sidebar, click Pages.
Under "GitHub Pages", select the GitHub Pages visibility drop-down menu, then click a visibility.
To see your published site, under "GitHub Pages", click your site's URL.
Note: It can take up to 10 minutes for changes to your site to publish after you push the changes to GitHub. If you don't see your GitHub Pages site changes reflected in your browser after an hour, see "About Jekyll build errors for GitHub Pages sites."