How to Install GitLab on Debian 12

how to install gitlab on debian 12

GitLab is an open-source platform for managing Git repositories used for collaborative software development. It offers a comprehensive suite of tools for source code management, continuous integration, and collaboration, and it’s a popular platform used by the DevOps team.

If you’re using Debian 12 and want to set up GitLab for your development projects, you’ve come to the right place.

In this tutorial, we will walk you through the step-by-step process of installing GitLab on your Debian 12 server.

Prerequisites

  • A server with Debian 12 as OS
  • User privileges: root or non-root user with sudo privileges
  • Minimum server requirements are 4x CPU and 4GB of RAM

Step 1. Update the system

If you already have an Apache server installed, you will need to stop the Apache server and disable the service.

# systemctl stop apache2 & systemctl disable apache2

Before we start with the installation of GitLab, we need to update the system packages to the latest versions available.

# apt-get update -y && sudo apt-get upgrade -y

Step 2. Install Gitlab

First, you will need to install the required packages for the GitLab installation and download and run the GitLab script.

# apt-get install curl ca-certificates apt-transport-https gnupg2 -y
# curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bash

Then you can run apt-get update once again to update the packages and run the GitLab installation with:

# apt-get install gitlab-ce

It will take some time for the installation to complete and install the Gitlab application and the other components.

Once the application is installed, you will need to edit the GitLab configuration file and enter the domain name that you are going to use to access Gitlab in external_url:

# nano /etc/gitlab/gitlab.rb
# external_url 'https://Your_Domain_Name'

Now run the following command to reconfigure GitLab.

# gitlab-ctl reconfigure

You may be missing some of the configuration files on your system and the Gitalab reconfigure command may fail.

In this case, you will need to manually create the configuration files with:

# touch /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.sem.conf
# touch /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmall.conf
# touch /opt/gitlab/embedded/etc/90-omnibus-gitlab-net.core.somaxconn.conf

Then you can run the reconfigure command again.

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS

If the reconfigure command was successful the first time, you can go ahead and open https://your_domain_name in your favorite browser.

To log in first time in GitLab, you can use the following information:

  • Username: root
  • Password: the root password can be found in /etc/gitlab/initial_root_password

If you can find the root password in that location, you can also use this command to reset the GitLab password.

gitlab-rake "gitlab:password:reset"

Once you log in to Gitlab, make sure to change the initial root password and use a new more complex password.

That was all. You successfully installed and configured Gitlab on Debian 12.

If you do not want to configure it on your own, you can sign up for one of our NVMe VPS plans and submit a support ticket. Our admins are available 24/7 and will start to work on your request immediately. Always trust our epic support.

If you liked this post on how to install Gitlab on Debian 12, please share it with your friends on social networks or simply leave a reply below. Thanks.

Leave a Comment