Skip to main content

Install Gitlab on Debian12

· One min read
Mohammad Zakery

How to Install

Gitlab

1.Install and configure the necessary dependencies.

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

2.Add the GitLab package repository and install the package.

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

sudo chmod 644 /usr/share/keyrings/gitlab_gitlab-ce-archive-keyring.gpg

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

3.Edit /etc/gitlab/gitlab.rb and change external_url.

external_url "http://gitlab.example.com"

4.Reconfigure GitLab:

sudo gitlab-ctl reconfigure

5.Retrieve the GitLab password using following command.

sudo cat /etc/gitlab/initial_root_password

6.Login to GitLab with the following address.

http://gitlab.example.com