News:

SMF - Mới vừa được cài đặt!

Main Menu

How to Install GitLab Self-Hosting on Ubuntu 24.04

Started by ccanpv, Apr 01, 2025, 04:00 AM

Previous topic - Next topic

ccanpv

 
Illustration of the process for installing GitLab on Ubuntu 24.04.
[color=var(--kenta-headings-color)]What's GitLab
GitLab is an open-source DevOps platform that provides a suite of tools for managing repositories, continuous integration/continuous deployment (CI/CD), and more. Using GitLab can streamline your development workflow and aid in project management.
[color=var(--kenta-headings-color)]Prerequisites[/color][/font][/size][/color]
  • A server running Ubuntu 24.04 or newest
  • A domain name pointing to your server's IP address (optional but recommended).
  • Basic knowledge of terminal commands.
[color=var(--kenta-headings-color)]How to Install GitLab
[color=var(--kenta-headings-color)]Update and Upgrade Your System[/color]
Before installing any new software, it's a good practice to update and upgrade your system:[/font][/size][/color]
apt update && apt upgrade -y

# Reboot to make sure the Linux used latest kernel
reboot
[color=var(--kenta-headings-color)]Install Required Dependencies
GitLab requires some dependencies to be installed. Install them using the following commands:[/font][/size][/color]
apt install -y curl openssh-server ca-certificates tzdata perl
[color=var(--kenta-headings-color)]Install Exim4 for Sending Email Notifications
You can use Exim4 for sending email notifications. Install it using the following command:[/font][/size][/color]
apt install -y exim4
[color=var(--kenta-headings-color)]Check the domain (HTTPS)
Make sure the domain name pointing to the server IP Address to make the SSL deployment automatically. After the domain pointing to the server IP, you could check using [/font][/size][/color]
dig or 
host command:
dig a gitlab.blackonsole.org

# OR

host -t a gitlab.blackonsole.org
[color=var(--kenta-headings-color)]Add the GitLab Repository
Add GitLab APT Repository before installing the packages. You could run by script:[/font][/size][/color]
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
[color=var(--kenta-headings-color)]Install the Package
Download and install the GitLab package. You'll need to use curl to download the script and then run it:[/font][/size][/color]
EXTERNAL_URL="https://gitlab.blackonsole.org" apt install -y gitlab-ee

...

gitlab Reconfigured!

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.



     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/


Thank you for installing GitLab!
GitLab should be available at https://gitlab.blackonsole.org
...
[color=var(--kenta-headings-color)]Check GitLab Services
To check the GitLab services running, you could use this command:[/font][/size][/color]
systemctl status gitlab-runsvdir.service
[color=var(--kenta-headings-color)]Configure GitLab
To configure GitLab, run the following command:[/font][/size][/color]
vim /etc/gitlab/gitlab.rb
# Configure you needed, then
# reconfigure GitLab to apply the config file
gitlab-ctl reconfigure
[color=var(--kenta-headings-color)] Access GitLab Web Interface
Open your web browser and go to your server's domain name or IP address. For example:[/font][/size][/color]
Quotehttps://gitlab.blackonsole.org
Where the default of user is 
root with the generated password in this file:
cat /etc/gitlab/initial_root_password
[color=var(--kenta-headings-color)]Conclusion
By following these steps, you should have GitLab up and running on your Ubuntu 24.04 server. GitLab offers a comprehensive suite of tools that can significantly improve your development process and team collaboration.[/font][/size][/color]
sources:   https://blackonsole.org/gitlab-installation-ubuntu-guide/