How to Install GitLab on Debian 12 (Bookworm): Complete Step-by-Step Guide

Install GitLab on Debian Bookworm

If you’re running Debian 12 (Bookworm) and want a powerful self hosted Git platform, GitLab Community Edition (CE) is one of the best choices. It combines source code management, CI/CD pipelines, issue tracking, and DevOps tools all in one place.

In this guide, you’ll learn how to install GitLab on Debian Bookworm, configure it correctly, and get your instance running smoothly.

Prerequisites

Before installing, make sure you have:

  • A Debian 12 (Bookworm) system with sudo privileges
  • 2 GB RAM minimum (4 GB recommended)
  • 2 vCPUs minimum
  • 10 GB+ of free disk space
  • A valid hostname (for example gitlab.example.com)
  • Basic familiarity with the Linux command line

Step 1 - Update Your System

Start by ensuring your system is up to date:

📄
filename
sudo apt update && sudo apt upgrade -y

Reboot afterward if kernel packages were updated:

📄
filename
sudo reboot

Step 2 – Install Required Dependencies

Install required packages and tools:

📄
filename
sudo apt install -y curl ca-certificates gnupg lsb-release

These ensure secure repository access and package verification.

Step 3 – Add The GitLab Repository

Add the official GitLab CE repository for Debian Bookworm:

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

GitLab’s script automatically detects Debian Bookworm and configures the correct repository.

Step 4 – Install GitLab CE

Run the installation command replacing gitlab.example.com with the domain you have chosen to use.

📄
filename
sudo EXTERNAL_URL="http://gitlab.example.com" apt install gitlab-ce -y

GitLab will install and configure NGINX, PostgreSQL, Redis, and other dependencies automatically.

Step 5 – Reconfigure GitLab

After installation run:

📄
filename
sudo gitlab-ctl reconfigure

This initializes GitLab, creates necessary services, and sets up SSL if configured later.

Step 6 – Access The Web Interface

Once the setup completes, open a browser and navigate to your GitLab URL:

📄
filename
https://gitlab.example.com

On the first login, you’ll be asked to set a password for the root user.

To find the temporary password generated during setup:

📄
filename
sudo cat /etc/gitlab/initial_root_password

Use this password to sign in as root, then change it immediately after logging in. 

Troubleshooting Tips

  • If installation fails, ensure your hostname resolves correctly and ports 80/443 are open.
  • For low-memory systems, create a swap file to prevent installation issues.
  • Use sudo gitlab-ctl tail to monitor logs in real time.

Conclusion

Installing GitLab on Debian 12 (Bookworm) is straightforward once you add the official repository and follow the proper configuration steps. You’ll have a robust, self hosted DevOps platform ready for collaboration, code management, and CI/CD pipelines all without relying on external services.

Call to Action

🚀 Have you set up GitLab on Debian Bookworm yet?

  • Share your installation experience or any challenges you faced.
  • What features of GitLab CE do you find most useful for your development workflow?

💬 Drop your comments below and help others streamline their setup!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.