News
Seven days of Black Friday madness — great deal from Serverspace!
DF
March 21 2023
Updated December 6 2024

Installing GitLab on Ubuntu

Git Ubuntu

GitLab is a repository management system for Git. The package includes a wiki, a web interface, and a bug tracking system. Consider setting up GitLab under Ubuntu 18.04.

With Serverspace you can create a server with the GitLab application already installed.

At the very beginning, we update the data about the packages in the repository and the system components:

apt-get update && apt-get upgrade

Installing the main packages:

apt-get install ca-certificates curl openssh-server
If any components are already installed, the system will ignore them.

Let's get to the installation.

Go to the /tmp directory.

cd /tmp

Download the installation script for Debian/Ubuntu:

curl -LO https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh

Executing the script:

bash /tmp/script.deb.sh

The program will install missing packages, import gpg keys, and configure the server to support GitLab repositories.

Installing missing packages

Install the current version of GitLab:

apt-get install gitlab-ce

During installation, about 81 MB of packages will be downloaded.
Final result:

2Installing the latest version of GitLab

Let's do the initial configuration:

gitlab-ctl reconfigure

This process is fully automated. At the end of the process, the console will look something like this.

Installing GitLab on Ubuntu | serverspace

Set up a firewall.

In order to be able to connect to GitLab from the outside, you need to configure a firewall. To do this, add an allow rule for the web port:

iptables -A INPUT -p tcp --dport 80 -j ACCEPT

Important! If port 80 does not suit you for some reason, for example, a web service already exists on this server, then you can change the port. To do this, edit the file:

nano /etc/gitlab/gitlab.rb

Change the external_url parameter. After the specified domain name, through a colon (“:”), specify the port number, for example 8080. As an example, it was:

external_url ‘http://gitlab.example.com’

It became:

external_url ‘http://gitlab.example.com:8080’

When you first navigate to the server address, the web interface will prompt you to set a password for the administrator account.

Set a password for the administrator account

After entering the password and confirming it, you will be redirected to the authorization page. Enter the username root and password from the paragraph above.

root username and password

Set up registration rules. Let's go to the Admin Area.

Installing GitLab on Ubuntu | serverspace

Then, in the side menu, open the settings (Settings). Next General. Opposite the Sign-up restrictions item, click on the Expand button. Check for the Sign-up enabled checkbox.

This parameter allows registration.

Установка GitLab на Ubuntu | Serverspace

Important! In order for users to receive emails when they register on the server, you must configure an email transfer agent.

Vote:
4 out of 5
Аverage rating : 4.5
Rated by: 2
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
ITGLOBAL.COM NL
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.