Installing GitLab Community Edition
I need an on-premises Git server for my labbing so this post will describe how to install GitLab Community Edition (CE). My install is on Ubuntu 24.04 LTS, specifically ubuntu-24.04.4-live-server-amd64, but you can use whatever works for you.
First I upgrade all the packages:
sudo apt update && sudo apt upgrade -y
Then install the dependencies for GitLab CE:
sudo apt install ca-certificates curl openssh-server postfix tzdata perl
In the installation for postfix, select Internet Site and then enter the server’s domain name. This is really only if you need to send e-mails.
Then reboot:
sudo reboot
I configure the hostname of the server:
sudo hostnamectl set-hostname gitlab.lab.local
I’ll update this later when installing a certificate for the server.
Then download the script that will add GitLab’s package repository to the system’s apt sources:
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
Next we setup the EXTERNAL_URL environment variable and install version 18.4 (I needed this specific version):
sudo EXTERNAL_URL="http://gitlab.lab.local" apt install -y gitlab-ce=18.4.*
The EXTERNAL_URL variable is read by the GitLab installer and this is the URL that the server will be available via. I’ll update Continue reading
