GitLab Community Edition is a full-featured DevOps platform that combines Git repository management, CI/CD pipelines, issue tracking, and a container registry in a single application. This guide installs GitLab CE on Ubuntu 24.04 LTS.

Tested and valid on:

  • Ubuntu 24.04 LTS

Prerequisites

  • Ubuntu 24.04 LTS server
  • Minimum 4 GB RAM (8 GB recommended)
  • A domain name pointed to the server
  • A user with sudo privileges

Step 1 – Install Dependencies

Install required packages:

sudo apt update
sudo apt install curl openssh-server ca-certificates tzdata perl -y

Step 2 – Add the GitLab Repository

Run the GitLab install script:

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

Step 3 – Install GitLab CE

Install and configure your external URL:

sudo EXTERNAL_URL="https://gitlab.example.com" apt install gitlab-ce -y

Step 4 – Retrieve the Initial Root Password

GitLab generates a temporary root password:

sudo cat /etc/gitlab/initial_root_password

Log into https://gitlab.example.com as root with this password. Change it immediately.

Step 5 – Configure Email (optional)

Edit the GitLab config for SMTP:

sudo nano /etc/gitlab/gitlab.rb

Set:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = 'smtp.gmail.com'
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = '[email protected]'
gitlab_rails['smtp_password'] = 'yourpassword'
gitlab_rails['smtp_domain'] = 'gmail.com'
gitlab_rails['smtp_authentication'] = 'login'
gitlab_rails['smtp_enable_starttls_auto'] = true

Reconfigure GitLab:

sudo gitlab-ctl reconfigure

Step 6 – Manage GitLab Services

Common management commands:

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

Step 7 – Create a Backup

Back up all GitLab data:

sudo gitlab-backup create

Conclusion

GitLab CE is now installed on Ubuntu 24.04 LTS with Let’s Encrypt SSL configured automatically. Create your first project, add team members, and enable CI/CD pipelines.