GitLab Community Edition, or GitLab CE is an open source web based Git repository featuring a wiki and issue tracking. In this guide, we’ll be installing GitLab CE and configuring SSL on an Ubuntu 18.04 Cloud Server.
A server with at least 8GB of ram
A domain name pointed at your server.
Before we can install GitLab, there are a few dependencies needed. First, update your apt cache:
sudo apt update
sudo apt install ca-certificates curl openssh-server postfix
During the postfix installation, select Internet Site. On the next page, enter your domain name.
Installing GitLab CE
Change directory to /tmp:
Grab the repository script from gitlab.com:
Install the repository:
sudo bash script.deb.sh
Install GitLab CE:
sudo apt install gitlab-ce
After the last command, you should have gotten a warning about setting your domain name. While fixing that, we’ll also go ahead and enable SSL with letsencrypt. Open the gitlab configuration file with nano:
sudo nano /etc/gitlab/gitlab.rb
Here you’re looking for the external_url field. Update it to match your domain name and change http to https. It should look something like this once done.
Next, look for the letsencrypt[‘contact_emails’] field. The email addresses here will be alerted if there is ever a problem with your SSL certificate. Once done, it should look something like this:
letsencrypt['contact_emails'] = ['email@example.com']
Save the file and exit. Now we’ll reconfigure gitlab to have it re-read the new configuration file. This part may take a few minutes.
sudo gitlab-ctl reconfigure
Once the reconfiguration is finished, navigate to your domain name in your web browser to start using GitLab CE!