How to add TLS to a custom domain on Gitlab Pages

November 15, 2016

Official Tutorial

  • Make sure letsencrypt-auto is executable (chmod +x letsencrypt-auto)
  • Use the command ./letsencrypt-auto certonly -a manual -d -d for all subdomains you want to include.
  • After a few screens, during which you’ll need to enter your email address, and give permission for you IP to be logged, you’ll be asked to add a page to your site.
Make sure your web server displays the following content at
before continuing:


\# output omitted

Press ENTER to continue
  • Once you do that, you’ll be asked to enter another page, same as above. Once added you’ll have saved files in /etc/letsencrypt/live/ and /etc/letsencrypt/live/
  • Enter these values in your project. Settings (gear on the top right) > Pages > + New Domain.
  • fullchaim.pem —> Certificate (PEM) | privkey.pem —> Key (PEM) | Do this for each (sub)domain you specified in Step 2.
  • It might take a little while, but your updated certificate should start to show up in ~10-15 minutes.

I'll tell you when I post stuff.

Subscribe to get my latest posts by email.