You can use custom domains:
To use one or more custom domain names:
You cannot verify the most popular public email domains .
To set up Pages with a custom domain name, read the requirements and steps below.
*.gitlab.io
example.com
subdomain.example.com
A
AAAA
ALIAS
CNAME
TXT
Follow the steps below to add your custom domain to Pages. See also this document for an overview on DNS records .
To add your custom domain to GitLab Pages:
After you add a new domain to Pages, the verification code prompts you. Copy the values from GitLab and paste them in your domain’s control panel as a TXT record on the next step.
Read this document for an overview of DNS records for Pages . If you’re familiar with the subject, follow the instructions below according to the type of domain you want to use with your Pages site:
Root domains ( example.com ) require:
35.185.44.232
2600:1901:0:7b8a::
_gitlab-pages-verification-code.example.com
gitlab-pages-verification-code=00112233445566778899aabbccddeeff
For projects on GitLab.com, the IPv4 address is 35.185.44.232 and the IPv6 address is 2600:1901:0:7b8a:: . For projects living in other GitLab instances (CE or EE), contact your sysadmin asking for this information (which IP address is Pages server running on your instance).
If you use your root domain for your GitLab Pages website only , and if your domain registrar supports this feature, you can add a DNS apex CNAME record instead of an A or AAAA record. The main advantage of doing so is that when GitLab Pages IP on GitLab.com changes for whatever reason, you don’t need to update your A or AAAA record. There may be a few exceptions, but this method is not recommended as it most likely doesn’t work if you set an MX record for your root domain.
MX
Subdomains ( subdomain.example.com ) require:
namespace.gitlab.io
_gitlab-pages-verification-code.subdomain.example.com
Whether it’s a user or a project website, the DNS record should point to your Pages domain ( namespace.gitlab.io ), without any path.
There are a few cases where you need to point both the subdomain and root domain to the same website, for instance, example.com and www.example.com .
www.example.com
They require:
_gitlab-pages-verification-code.www.example.com
If you’re using Cloudflare, check Redirecting www.domain.com to domain.com with Cloudflare .
www.domain.com
domain.com
Additionally:
subdomain.domain.com
namespace.gitlab.io/
namespace.gitlab.io.
52.167.214.135
After you have added all the DNS records:
As soon as your domain becomes active, your website is available through your domain name.
Considering GitLab instances with domain verification enabled, if the domain can’t be verified for 7 days, it’s removed from the GitLab project.
You can add more than one alias (custom domains and subdomains) to the same project. An alias can be understood as having many doors leading to the same room.
All the aliases you’ve set to your site are listed on Setting > Pages . From that page, you can view, add, and remove them.
If you use Cloudflare, you can redirect www to domain.com without adding both www.domain.com and domain.com to GitLab.
www
To do so, you can use Cloudflare’s page rules associated to a CNAME record to redirect www.domain.com to domain.com . You can use the following setup:
https://domain.com
Read this document for an overview on SSL/TLS certification .
To secure your custom domain with GitLab Pages you can opt by:
You can use any certificate satisfying the following requirements:
For example, Cloudflare certificates meet these requirements.
To add the certificate at the time you add a new domain:
To add the certificate to a domain previously added:
Do not open certificates or encryption keys in regular text editors. Always use code editors (such as Sublime Text, Dreamweaver, Brackets, etc).
To make your website’s visitors even more secure, you can choose to force HTTPS for GitLab Pages. By doing so, all attempts to visit your website through HTTP are automatically redirected to HTTPS through 301.
It works with both the GitLab default domain and with your custom