GitLab is a powerful DevOps software package that combines the ability to develop, secure, and operate software in a single application. In this step-by-step guide, we will walk you through the process of installing GitLab on RockyLinux 8. By the end of this tutorial, you will have a fully functional GitLab instance up and running on your system.
Prerequisites
Before we begin, let’s ensure that your system meets the minimum requirements for installing GitLab. You will need at least 4GB of system RAM to run GitLab smoothly. If your system meets this requirement, you’re ready to proceed.
Step 1: Update the System
The first step is to update the available packages on your RockyLinux 8 system to their latest versions. Open your terminal and enter the following command:
sudo yum update -y && sudo yum upgrade -y
This command will update all the packages installed on your system to their latest versions.
Step 2: Install the Required Packages
Next, we need to install some dependencies that GitLab requires. Run the following command to install the necessary packages:
sudo dnf -y install curl vim policycoreutils python3-policycoreutils git
This command will install the required packages on your system.
Step 3: Add the GitLab CE Repository on RockyLinux 8
To install GitLab CE on RockyLinux 8, we need to add the GitLab CE repository. Open the terminal and enter the following command to create a new repository file:
sudo vim /etc/yum.repos.d/gitlab_gitlab-ce.repo
Once the file is open, add the following lines to it:
[gitlab_gitlab-ce]
name=gitlab_gitlab-ce
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[gitlab_gitlab-ce-source]
name=gitlab_gitlab-ce-source
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/SRPMS
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
Save the file and exit the text editor.
Step 4: Install GitLab CE on RockyLinux 8
Now that we have added the GitLab CE repository, let’s install GitLab CE on RockyLinux 8. Run the following command to install GitLab CE:
sudo dnf install gitlab-ce -y
This command will download and install GitLab CE along with its dependencies. The installation may take a few minutes to complete.
Step 5: Configure GitLab CE on RockyLinux 8
Once the installation is complete, we need to configure GitLab CE. Open the GitLab configuration file using the following command:
sudo vim /etc/gitlab/gitlab.rb
In the configuration file, locate the line that starts with external_url
and replace http://gitlab.example.com
with your actual domain name. Save the file and exit the text editor.
To apply the changes, run the following command:
sudo gitlab-ctl reconfigure
This command will reconfigure GitLab with the updated settings.
Step 6: Verify GitLab Installation
After the configuration is complete, let’s check the status of GitLab to ensure that it is running correctly. Enter the following command:
sudo gitlab-ctl status
If everything is set up correctly, you should see a list of running services, indicating that GitLab is up and running.
Step 7: Access the GitLab Web Console
Now that GitLab is installed and running, let’s access the GitLab web console. Open your web browser and enter the URL http://gitlab.example.com
. Replace gitlab.example.com
with your actual domain name.
You will be prompted to set up an administrator account. Enter the username and password of your choice and click on the “Create account” button.
Step 8: Allow Ports on Firewall
To ensure that GitLab is accessible from other devices on your network, you need to allow HTTP and HTTPS traffic through the firewall. Run the following commands to enable these ports:
sudo firewall-cmd --permanent --zone=public --add-service=http sudo firewall-cmd --permanent --zone=public --add-service=https sudo firewall-cmd --reload
These commands will open the required ports on the firewall.
Step 9: Change GitLab Password
For security purposes, it is recommended to change the default password for the GitLab administrator account. To do this, log in to the GitLab web console using the credentials you set up earlier.
Once logged in, navigate to the “Profile Settings” page and click on “Change your password.” Follow the prompts to change your password.
Step 10: Additional Configuration (Optional)
GitLab offers a wide range of configuration options to customize your instance. You can explore these options by referring to the official GitLab documentation.
Conclusion
Congratulations! You have successfully installed GitLab on RockyLinux 8. You now have a powerful DevOps software package at your disposal, allowing you to develop, secure, and operate software seamlessly. GitLab offers a robust set of features and can be further customized to meet your specific requirements.
If you have any questions or need further assistance, feel free to reach out to the Shape.host support team. Shape.host offers reliable and scalable Linux SSD VPS hosting services, providing you with the infrastructure you need to host your GitLab instance securely and efficiently.