GitLab is a free and open-source DevOps platform on which programmers can collaborate while developing a source code. The platform was specially created for remote work. So far, GitLab has about 30 million registered users, out of which 1 million are active license users.
Here at Ibmi Media, we shall look into how to install GitLab on Rocky Linux 8.
To see how you can install GitLab on Ubuntu 20.04, visit: https://linuxapt.com/blog/460-install-gitlab-in-ubuntu-20-04.
Requirements for Gitlab Installation includes:
- A valid Domain name mapped to your server.
- Omnibus GitLab package takes 2.5 GB of space.
- 4 GB RAM (minimum).
- CPU: 4 cores (minimum).
Steps to install Gitlab on Rocky Linux
1. Perform System Update
It's recommended to update your system before installing any new software, especially if you plan to install GitLab. Run the following command to update your system:
$ sudo dnf check-update
$ sudo dnf update -y
$ sudo dnf -y upgrade
2. Configure SSH
You can skip this step if SSH is already enabled on your system.
Download and install the OpenSSH-server perl package with this command:
$ sudo dnf install -y curl policycoreutils openssh-server perl
To check the status of the OpenSSH daemon, run the following command:
$ sudo systemctl status sshd
Next, Enable the daemon with this command:
$ sudo systemctl enable sshd
Now start the ssh service by running this command:
$ sudo systemctl start sshd
3. Configure Firewall
Here, we will configure the system firewall to allow HTTP and HTTPS access. This is also an optional step; you can skip it.
To check the status of the firewall, run:
$ sudo systemctl status firewalld
To open HTTP service on the system firewall, use this command:
$ sudo firewall-cmd --permanent --add-service=http
Now add HTTPS service on the system firewall with this command:
$ sudo firewall-cmd --permanent --add-service=https
To update configurations, restart the firewall.
$ sudo systemctl reload firewalld
4. Install Postfix
To send notification emails, we will need to install Postfix. If you want to use another service to deal with notification emails, like SMTP, you can skip this step. You can configure the settings after installation.
To use the Postfix service, install it with the below command:
$ sudo dnf install postfix
Once the installation is completed, enable the service with the help of this command:
$ sudo systemctl enable postfix
Now start the service with this command:
$ sudo systemctl start postfix
A configuration screen will appear during the installation of Postfix. Select 'Internet Site' and press enter. For DNS configuration, use your server's external DNS for 'mail name'. In case more screens appear, keep pressing enter to accept the default configurations.
5. Add and Install GitLab package
Here we will download and install GitLab on our system.
To add the GitLab package repository, run this command:
$ curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
To install the package, we will run the command below. Make sure to change https://gitlab.example.com to the URL at which you want to run your GitLab instance:
$ sudo EXTERNAL_URL="https://gitlab.example.com" dnf install -y gitlab-ee
Once the installation is all done, try accessing the external URL that you gave for GitLab. This will open GitLab login page for you.
A random password will be generated and stored in the /etc/gitlab directory with the name initial_root_password.
To log in, use root as your username and the password stored in the initial_root_password file. The password file will automatically be deleted after 24 hours. Make sure to reset the password.
How to uninstall GitLab from Rocky Linux 8 ?
1. Stop GitLab service
Now that we have seen how to install GitLab, let’s also see how can we uninstall this service. To do that, you first need to stop GitLab. Do that by running this command:
$ sudo gitlab-ctl stop
2. Remove GitLab
Now you can uninstall GitLab with this command:
$ sudo gitlab-ctl uninstall
3. Remove the GitLab package
The uninstall step will not completely uninstall GitLab. You will also have to remove GitLab package. Do that with this command:
$ sudo yum remove gitlab-ee
After this step, reboot the machine to kill all the previous GitLab processes. GitLab will be completely uninstalled after the reboot.
[Need help in fixing GitLab issues ? We can help you. ]