The Gitlab self-hosted application uses HTTP by default. You can enable HTTPS by performing a couple of steps. You need to acquire an SSL certificate and corresponding key for a domain that is under your control, and tell Gitlab that it needs to use these resources.

Create a directory which will hold the certificate and key:

mkdir -p /etc/gitlab/ssl
chmod 0700 /etc/gitlab/ssl

Copy your certificate file (either .crt or .pem) and key file into this directory:

cp /etc/gitlab/ssl
chmod 0600 /etc/gitlab/ssl/*

Edit the file /etc/gitlab/gitlab.rb:

external_url '’
nginx['ssl_certificate'] = "/etc/gitlab/ssl/"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/"

Reconfigure Gitlab to apply the changes:

gitlab-ctl reconfigure
Enable HTTPS on Gitlab
Tagged on:

One thought on “Enable HTTPS on Gitlab

  • 2020-05-07 at 14:09

    Is there any possible to configure Self Signed certificate without a domain name (using IP)?


Leave a Reply

Your email address will not be published. Required fields are marked *