GitLab is one of the most powerful DevOps tools available today. If you’re running a team or an enterprise that prefers self-hosting, GitLab Self-Managed is the way to go. This guide walks you through the process of GitLab installation on Ubuntu 24.04, ensuring a secure and fully functional setup.
Prerequisites
Before starting the GitLab Installation, ensure the following requirements:
- Supported Ubuntu versions: 24.04
- Server with Minimum 8 GB RAM
- DNS correctly configured for your server (e.g :- gitlab.codinol.top)
- Root or sudo access to the server
- Open ports: 22 (SSH), 80 (HTTP), 443 (HTTPS)
Step 1: Login via SSH to the server
ssh root@server_ip
Now Configure UFW to allow the necessary traffic:
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
Step 2: Add the GitLab Package Repository
Install curl (if not already installed):
sudo apt install curl
Now, add the GitLab Community Edition (CE) package repository:
curl "https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh" | sudo bash
Step 3: Install GitLab CE
Set the external URL where GitLab will be accessible. This is important for generating SSL certificates and proper routing
sudo EXTERNAL_URL="https://gitlab.codinol.top" apt install gitlab-ce
Replace “gitlab.codinol.top” with your domain or server IP. If you use HTTPS, GitLab will automatically attempt to get a Let’s Encrypt certificate.
Step 4: Access and Configure GitLab
Once the GitLab Installation is complete:
- Visit your GitLab instance at https://gitlab.codinol.top
- The first time you log in, use the credentials generated for the root account.
GitLab will store the default password in /etc/gitlab/initial_root_password:
cat /etc/gitlab/initial_root_password
This file is deleted automatically after 24 hours for security. Make sure to save the password somewhere secure.
You can log in to GitLab using the username root and the password retrieved from the /etc/gitlab/initial_root_password file in the previous step.
Do you need help with your GitLab installation on Ubuntu 24.04? Our experts are here to assist! Contact us today for professional server management services and seamless GitLab setup tailored to your infrastructure needs.