Professional Documents
Culture Documents
Menu
···
In this post, we will show you how install GitLab CE (Community Edition) on Debian 12 (Bookworm)
system step-by-step.
GitLab is a powerful web-based platform for version control and DevOps collaboration. It allows
developers to manage and track their source code repositories, collaborate with team members, and
automate various DevOps processes.
Table of Contents
Prerequisites
1) Update the System
2) Install GitLab Dependencies
3) Install Gitlab on Debian 12
4) Configure Gitlab
5) Access Gitlab Web Interface
6) Change Root Password
7) Secure Gitlab using Let’s Encrypt SSL Certificate
Prerequisites
Before getting started, ensure that you have the following in place:
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 1/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
···
An instance of Debian 12 with SSH access.
Minimum of 8 GB RAM
20GB of hard disk space
A valid domain name pointed to the IP address of the server.
User with sudo rights
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 2/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
$ curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.de
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 3/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
During the installation, you will see a notification that GitLab has not yet been configured as well as
not being able to detect a hostname for your instance. In addition, you will be required to configure a
URL for your instance by setting the `external_url` directive in the /etc/gitlab/gitlab.rb configuration
file.
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 4/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
4) Configure Gitlab
To configure your GitLab installation, you need to edit the ‘github.rb’ file as indicated in the summary
output. Here we will use the vi editor to open the file.
$ sudo vi /etc/gitlab/gitlab.rb
Search and locate the ‘external_url‘ parameter. Update the field to correspond to your domain as
follows:
external_url ‘http://domain.com’
external_url ‘http://crazytechgeek.info’
Next, locate the letsencrypt[‘contact_emails’] field and update it to include an email address that
will be used to alert the user when the Let’s Encrypt SSL certificate nears its expiration date.
letsencrypt[‘contact_emails’] = [‘admin@linuxtechi.com’]
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 5/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
Finally, save the file and reconfigure the GitLab installation as shown.
The reconfiguration takes a while – roughly 7 minutes. Once done, you should get the notification
‘GitLab Reconfigured!’.
$ cat /etc/gitlab/initial_root_password
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 6/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
http://domain.com
Use `root` as the username and the password from the initiall_root_password file then click ‘Sign In’.
Next, navigate and select ‘Password’ and create a new password. Then click ‘Save password’ to
save the new password that you have just created.
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 8/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
GitLab configuration supports Let’s Encrypt and, in this step, we will configure our Gitlab instance to
use Let’s Encrypt SSL for secure connections.
$ sudo vi /etc/gitlab/gitlab.rb
letsencrypt['enable'] = true
letsencrypt['auto_renew'] = true
The first line allows Let’s Encrypt to be configured and the second line sets the renewal of the
certificate to be automatic.
Along with that, you can define the auto-renewal hour and day of the month as follows:
letsencrypt['auto_renew_hour'] = 5
letsencrypt['auto_renew_day_of_month'] = "*/6"
external_url 'https://crazytechgeek.info'
Save the changes and exit the config file. To effect the changes, once again, run the command
below.
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 9/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
Now Reload the browser. This time around, you will notice that the URL to your server’s instance is
now secured using Let’s Encrypt SSL certificates.
This wraps up our guide for today. In this guide, we showed you how to install and configure GitLab
on Debian 12 step-by-step.
I hope you have found it informative and useful. Kindly do post your queries and feedback in below
comments section.
Share Now!
Leave a Comment
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 10/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
Name *
Email *
Post Comment
Search …
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 11/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
Recent Posts
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 12/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
dyson_ro
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 13/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 14/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 15/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 16/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 17/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 18/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 19/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 20/21
11/26/23, 11:46 AM How to Install GitLab on Debian 12 Step-by-Step
Follow Us
© 2023 LinuxTechi
https://www.linuxtechi.com/how-to-install-gitlab-on-debian/ 21/21