How to Install GitLab on AlmaLinux 10

How to install GitLab on AlmaLinux 10

GitLab is one of the most popular self-hosted DevOps tools available today. It provides a web-based Git repository manager with CI/CD, issue tracking, code review, and more – all in one application. In this guide, we’ll walk you through how to install GitLab on AlmaLinux 10, a stable and secure RHEL-based Linux distribution ideal for hosting applications like GitLab. In this guide, we’ll show you how to install GitLab on AlmaLinux 10.

Prerequisites

Before we start with the installation, there are a few requirements that need to be fulfilled:
• A VPS with at least 4GB of RAM (8GB+ recommended)
• AlmaLinux 10 OS
• User privileges: root or non-root user with sudo privileges
• A domain name pointing to your server’s IP (e.g., gitlab.yourdomain.com)

Step 1: Update the System

Before installing any packages, make sure your system is up to date.

sudo dnf update -y

Step 2. Install Dependencies

Ensure that you have installed all the necessary dependencies for GitLab.

sudo dnf install -y curl policycoreutils openssh-server openssh-client

Step 3: Install Postfix

Also, ensure that your system has postfix or another mail transfer agent installed (used by GitLab to send notifications):

sudo dnf install -y postfix
sudo systemctl enable postfixsudo systemctl start postfix

Step 4: Enable the Required Repositories

GitLab provides a package repository that you can install with the following command:

wget https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh
mv script.rpm.sh script.sh
chmod +x script.sh
os=almalinux dist=9 ./script.sh

At the time of writing, AlmaLinux 10 OS is not officially added to the installation script; you can install the repository using the commands above.

If you have followed the steps, you should receive the message

The repository is setup! You can now install packages.

Then all you need to do is run the following command and replace the gitlab.example.com with your domain or subdomain that has a valid A record pointing to your server.

EXTERNAL_URL="http://gitlab.example.com" sudo dnf install -y gitlab-ee

Then the installation will start, and it may take some time to complete. If the installation is completed successfully, you should receive a similar message.

     _______ __  __          __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/
Thank you for installing Gitlab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure

You may also get the warning message if the hostname is not configured as the EXTERNAL_URL used in the installation step. You should edit the hostname, log out, and then log in again for the changes to take effect. Or check if you used the correct domain/subdomain in the /etc/gitlab/gitlab.rb file and edit the file if needed.

Then you can re-run the gitlab-ctl reconfigure script.

Step 5. Configure Gitlab

After the installation is complete, configure GitLab by running the following command:

sudo gitlab-ctl reconfigure

After the configuration is completed, go ahead and start the GitLab service with

Sudo gitlab-ctl start

Now you can go ahead and navigate to the EXTERNAL_URL used in the installation, https://gitlab.example.com

The first time you access GitLab, you’ll be prompted to set a password for the root user. After setting the password, you can log in with:
• Username: root
• Password: (your newly created password)

To start, stop, and restart to manage Gitlab, you can use the same commands:

sudo gitlab-ctl start
sudo gitlab-ctl stop
sudo gitlab-ctl restart

You can also check the status of the service with:

sudo gitlab-ctl status

Step 6. Using gitlab-ctl

Please note that if you make any new changes in the gitlab.rb file, such as enabling Let’s Encrypt, you will need to always run gitlab-ctl reconfigure command.
The gitlab-ctl command line tool offers a wider array of commands that make it easy to manage, restart, monitor, and debug all components of your GitLab instance. To separately manage individual components

You can also monitor all services or separate services with the commands:

sudo gitlab-ctl tail - Tails logs from all GitLab services (like tail -f).
sudo gitlab-ctl tail - Tails logs of a specific service (e.g., gitlab-ctl tail nginx).

You can check the gitlab-ctl commands on the following link: https://docs.gitlab.com/omnibus/maintenance/

Conclusion

You now have GitLab successfully installed on your AlmaLinux 10 server. This powerful platform enables you to manage your code, pipelines, and projects with full control, backed by the performance and security of AlmaLinux.

If you want hassle-free server management, LinuxHostSupport’s monthly server management or per-incident server support can set up and manage GitLab (and much more) for you, allowing you to focus on development while we take care of your infrastructure.

Leave a Reply

Your email address will not be published. Required fields are marked *