How to setup Gitlab EE on Ubuntu OS

How to setup Gitlab EE on Ubuntu OS

gitlab_ee_setup_on_ubuntu_os

Here in this article we will try to install GitLab EE 18.6 Linux package onto Ubuntu OS 24.04.

Test Environment

  • Ubuntu 24.04 OS

Procedure

Step1: Ensure SSH service enabled

Ensure that you have Ubuntu OS 24.04 installed and running on your system or virtual machine. Make sure to update the packages to the latest version and install the OpenSSH server to enable SSH access.

ubadmin@ubser1:~$ sudo apt-get update
ubadmin@ubser1:~$ sudo apt-get upgrade

ubadmin@ubser1:~$ sudo apt-get install openssh-server
ubadmin@ubser1:~$ sudo systemctl start ssh.service
ubadmin@ubser1:~$ sudo systemctl enable ssh.service

Step2: Enable Firewall and Open Ports

Here we will enable firewall and allow access on port 22, 80 and 443 as shown below for remote access.

ubadmin@ubser1:~$ sudo ufw allow 22/tcp
ubadmin@ubser1:~$ sudo ufw allow 80/tcp
ubadmin@ubser1:~$ sudo ufw allow 443/tcp

ubadmin@ubser1:~$ sudo ufw enable
ubadmin@ubser1:~$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere                  
80/tcp                     ALLOW       Anywhere                  
443/tcp                    ALLOW       Anywhere                  
22/tcp (v6)                ALLOW       Anywhere (v6)             
80/tcp (v6)                ALLOW       Anywhere (v6)             
443/tcp (v6)               ALLOW       Anywhere (v6)

Step3: Add GitLab deb repository

Now let’s configure ubuntu with the gitlab deb package repository by running the “script.deb.sh” using curl.

ubadmin@ubser1:~$ sudo apt-get install curl
ubadmin@ubser1:~$ curl "https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh" | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7208  100  7208    0     0  15543      0 --:--:-- --:--:-- --:--:-- 15568
Detected operating system as Ubuntu/noble.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Detected apt version as 2.8.3
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/gitlab_gitlab-ee.list...done.
Importing packagecloud gpg key... Packagecloud gpg key imported to /etc/apt/keyrings/gitlab_gitlab-ee-archive-keyring.gpg
done.
Running apt-get update... done.

The repository is setup! You can now install packages.

Step4: Install GitLab

Once the repository is configured its time to insatll the GitLab package using the custom email address and password for the root administrative account and also specifying the url where the GitLab portal will be accessed.

ubadmin@ubser1:~$ sudo GITLAB_ROOT_EMAIL="ubadmin@stack.com" GITLAB_ROOT_PASSWORD="your_strong_password" EXTERNAL_URL="http://ubser1.stack.com" apt install gitlab-ee
...
Thank you for installing GitLab!
GitLab should be available at http://ubser1.stack.com

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=18-6

Step5: Validate GitLab installation

Its time to validate your GitLab portal access by launching the below url and logging with your root administrative account.

URL: http://ubser1.stack.com
ubadmin@ubser1:~$ sudo gitlab-ctl status
[sudo] password for ubadmin: 
run: alertmanager: (pid 19950) 1066s; run: log: (pid 19714) 1109s
run: gitaly: (pid 19907) 1069s; run: log: (pid 19115) 1268s
run: gitlab-exporter: (pid 19906) 1069s; run: log: (pid 19648) 1128s
run: gitlab-kas: (pid 19390) 1258s; run: log: (pid 19408) 1257s
run: gitlab-workhorse: (pid 19860) 1070s; run: log: (pid 19555) 1147s
run: logrotate: (pid 19020) 1283s; run: log: (pid 19052) 1280s
run: nginx: (pid 19886) 1070s; run: log: (pid 19602) 1140s
run: node-exporter: (pid 19900) 1069s; run: log: (pid 19628) 1136s
run: postgres-exporter: (pid 19963) 1066s; run: log: (pid 19742) 1104s
run: postgresql: (pid 19158) 1264s; run: log: (pid 19195) 1261s
run: prometheus: (pid 19926) 1068s; run: log: (pid 19685) 1118s
run: puma: (pid 19457) 1161s; run: log: (pid 19470) 1158s
run: redis: (pid 19056) 1277s; run: log: (pid 19066) 1274s
run: redis-exporter: (pid 19918) 1069s; run: log: (pid 19663) 1124s
run: sidekiq: (pid 19478) 1155s; run: log: (pid 19494) 1154s

Step6: Manage GitLab services

ubadmin@ubser1:~$ sudo systemctl stop gitlab-runsvdir.service 
ubadmin@ubser1:~$ sudo systemctl disable gitlab-runsvdir.service 
Removed "/etc/systemd/system/multi-user.target.wants/gitlab-runsvdir.service".

Start GitLab services manually on every reboot and check status of all the services

ubadmin@ubser1:~$ sudo systemctl start gitlab-runsvdir.service
ubadmin@ubser1:~$ sudo gitlab-ctl status 

Hope you enjoyed reading this article. Thank you..