Can I make gitlab pages private?

I just started using gitlab pages on gitlab.com for a public project. I also have a private repository I would like to restrict access to the generated pages to only those with access to the repository. Is that possible?

If not, are there any other supported authentication methods?

1 Like

No, this is not possible. Pages are always visible not matter the project visibility level. If your project is private, people would have to guess the url anyway, so you could say it’s a level of restriction.

There is an issue for gitlab-ce (Community Edition) concerning Access Control for gitlab pages:

As of February 2018, this is not closed yet, but it doesn’t mean it’s “not possible”.

1. Gitlab pages behind your own private gitlab installation:

If you are using your own gitlab installation (not gitlab.com), and your gitlab installation is in a private network only accessible with a vpn, then only users behind that vpn will have access to your generated gitlab-pages.

2. Publish to a private server:

Another solution using gitlab.com would be to deploy your website somewhere online using gitlab-ci and use your own authentication system. Or you can upload generated content to a private AWS S3 bucket. Here’s an example of how to setup a S3 bucket with Authentication

The following guide will show you how to use gitlab-ci and the awscli to deploy your html files to AWS S3:

So in the end, I don’t think answering “No” is the right answer here.

For anyone here arriving late, like me…

gitlab-org/omnibus-gitlab: Merge Request: Support for pages authentication switches (Merged)

gitlab-org/gitlab-ce: Merge Request: Make GitLab pages support access control (Merged)

gitlab-org/gitlab-pages: Merge Request: Make GitLab pages support access control (Merged)

gitlab-com/gl-infra: Issue: Enable Pages access control (Open)

gitlab-org/gitlab-ce: Issue: Enable access control for pages on gitlab.com (Open)

1 Like

Is it possible to create a public gitlab.com page from private repo?

Because in GitHub your GitHub page must be in a public repo.

Add robots.txt and choose a cryptic/generated repo name?

1 Like