How to Install GitLab on a Linux Server with Let’s Encrypt SSL

  • Post last modified:October 21, 2023
  • Post category:Linux / Web
  • Post comments:2 Comments
  • Reading time:7 mins read

In this post, im going to talk about the steps to install GitLab on a Linux server and secure it with a Let’s Encrypt SSL certificate.

You need to have the following Things:

  • A server running a Linux distribution such as Ubuntu or Debian
  • A domain name that points to your server IP address
  • Root access to your server

Table of Contents:

Step 1: Update the System

The first step is to upgrade your system packages:

sudo apt-get update && sudo apt-get upgrade -y

Step 2: Install Required Dependencies


Install some required dependencies for GitLab:

sudo apt-get install -y curl openssh-server ca-certificates postfix

For Postfix Installation. Choose the “Internet Site” option and enter your domain name.

selecting internet site for postfix
system mail name for postfix

Step 3: Install GitLab

Add the GitLab package repository to your system.

curl | sudo bash

Now install GitLab:

sudo apt-get install gitlab-ee

This will install the GitLab Community Edition on your system.

gitlab install complete

Step 4: Configure GitLab

Open the GitLab configuration:

sudo nano /etc/gitlab/gitlab.rb

Find this lines in the config file:

# external_url ''
# letsencrypt['contact_emails'] = ['[email protected]']

Uncomment the first line and replace with your domain name:

external_url ''
adding domain name with https

Uncomment the second line and replace [email protected] with your email address:

letsencrypt['contact_emails'] = ['[email protected]']
click here for more details about the SSL config

Save and close the file.

Step 5: Configure Let’s Encrypt SSL

To enable Let’s Encrypt SSL for GitLab:

sudo gitlab-ctl reconfigure

This command will generate a Let’s Encrypt SSL certificate for your domain name and configure GitLab to use it.

Step 6: Access GitLab

You can access it by navigating to in your web browser.


User name: root and To view the password, run:

cat /etc/gitlab/initial_root_password

Make sure to change your password after you log in.

gitlab login page
gitlab dashboard


In this guide, i have covered the steps to install GitLab on a Linux server and secure it with a Let’s Encrypt SSL certificate. If you have any questions leave a comment thank you…

This Post Has 2 Comments

    1. Udara Kalana

      try removing sudo like this :
      curl | bash

Leave a Reply