How to Install GitLab on Debian 13

GitLab is a web-based DevOps lifecycle tool that provides a Git repository manager offering wiki, issue tracking, and continuous integration and deployment pipeline features, using an open-source license, developed by GitLab Inc.

Update the system

apt update

apt upgrade

Install required dependencies

apt-get install -y curl ca-certificates apt-transport-https gnupg2

Add Gitlab Repository using the below command

echo "deb [signed-by=/usr/share/keyrings/gitlab-ce-archive-keyring.gpg] https://packages.gitlab.com/gitlab/gitlab-ce/debian bookworm main" | sudo tee /etc/apt/sources.list.d/gitlab_gitlab-ce.list

Import GitLab’s GPG key:

curl -fsSL https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/gitlab-ce-archive-keyring.gpg

Save and close the file and update the repository using the below command,

apt-get update

Install GitLab CE

apt-get install gitlab-ce -y

Output:

root@Debian13Server:~# apt-get install gitlab-ce -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  gitlab-ce

Configure GitLab

Once the installation is complete, we will configure the GitLab to our requirements.
Below are the edits that can be done,

nano /etc/gitlab/gitlab.rb

Replace the following line with your domain name,

external_url 'https://Your_Domain_Name'

Replace/Edit the following lines to enable the Let's Encrypt SSL,

# Enable the Let's encrypt SSL
letsencrypt['enable'] = true

# This is optional to get SSL related alerts
letsencrypt['contact_emails'] = ['youremail@mail.com']

# This example renews every 1st day at 01:00 AM
letsencrypt['auto_renew_hour'] = "1"
letsencrypt['auto_renew_minute'] = "0"
letsencrypt['auto_renew_day_of_month'] = "*/1"

Save and close the file.

Let us update the repository now with the following command,

gitlab-ctl reconfigure

Output:

root@Debian13Server:~# gitlab-ctl reconfigure
[2025-08-18T21:20:11+00:00] INFO: Started Cinc Zero at chefzero://localhost:1 with repository at /opt/gitlab/embedded (One version per cookbook)
Cinc Client, version 18.3.0
Patents: https://www.chef.io/patents
Infra Phase starting
[2025-08-18T21:20:11+00:00] INFO: *** Cinc Client 18.3.0 ***
[2025-08-18T21:20:11+00:00] INFO: Platform: x86_64-linux
[2025-08-18T21:20:11+00:00] INFO: Cinc-client pid: 13944
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/ffi-yajl-2.6.0/lib/ffi_yajl/encoder.rb:42: warning: undefining the allocator of T_DATA class FFI_Yajl::Ext::Encoder::YajlGen
[2025-08-18T21:20:13+00:00] INFO: Setting the run_list to ["recipe[gitlab-base]"] from CLI options
[2025-08-18T21:20:13+00:00] INFO: Run List is [recipe[gitlab-base]]
[2025-08-18T21:20:13+00:00] INFO: Run List expands to [gitlab-base]
[2025-08-18T21:20:13+00:00] INFO: Starting Cinc Client Run for Debian13Server
[2025-08-18T21:20:13+00:00] INFO: Running start handlers
[2025-08-18T21:20:13+00:00] INFO: Start handlers complete.
Resolving cookbooks for run list: ["gitlab-base"]

Retrieve the GitLab password using the following command,

cat /etc/gitlab/initial_root_password

Output:

root@server:~# cat /etc/gitlab/initial_root_password
# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: sfC7QoruHZwNUt/WCQtyDa0uFldUUV+vdGBlitq/Bww=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

Open a browser and type the following address and you will be redirected to the GitLab login page,

Replace Your_Domain_Name with the Actual Domain name

https://Your_Domain_Name

image

image

Done.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS