Skip to content

Secure your Gitlab with LetsEncrypt certificates

LetsEncrypt provides a simple & cost effective solution to secure your self hosted Gitlab.

Start by cloning the letsencrypt repository and run the script

LetsEncrypt need to make sure you are the owner of your domain via accessing some of your content on your server. GitLab serves it static content from /opt/gitlab/embedded/service/gitlab-rails/public, so we can generate our certificates with this single command line:

Now you have your certificates, just update your gitlab configuration file to use your new certificates. Mine is in /etc/gitlab/gitlab.rb
Last but not least, reconfigure your gitlab
Two important notes:
1) LetsEncrypt certificates are valid only 3 months, so you need to repeat the letsencrypt-auto script every now and then.
2) If you are on Chrome, you will need to restart it for the new certificate to be effective in your browser.
https1
Share your thoughts