Three Steps To Install Gitlab on Debian

This post summarizes how to install gitlab on your debian server. Debian 10 is used in our case.

Prerequisites

The first step is to install prerequisites.

sudo apt update && sudo apt upgrade
sudo apt install -y vim curl ca-certificates apt-transport-https

Install Gitlab

Next, let’s install gitlab. Replace the {GITLAB_URL} with your own real gitlab url before running the following command.

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

sudo EXTERNAL_URL="http://{GITLAB_URL}" apt install gitlab-ce

Set Up Gitlab Root Password

Start gitlab-rails

sudo gitlab-rails console -e production

Update the root user password

user = User.where(id: 1).first
user.password = 'password'
user.password_confirmation = 'password'
user.save!

Here, we are using ‘password’ as our password. For your case, you can use anything you like.

Check Out Gitlab Server

Once you finish the above steps, you can check out your gitlab server by visiting http://{GITLAB_URL} (where {GITLAB_URL} was set at the second step), and you should see something like this: