In this article, we will show you how to install Gitlab on an Ubuntu 16.04 virtual server. GitLab is a modern and fast open source web-based Git repository manager with issue tracking features, continuous integration and delivery, user roles, todos and much more. It’s a self-hosted alternative to GitHub.
Related Articles
Login to your Ubuntu VPS via SSH
ssh my_sudo_user@my_server
Update the system and install all necessary packages
sudo apt update && sudo apt -y upgrade sudo apt install curl nano git
Make sure to regularly update the system or configure automatic updates.
Requirements
This guide assumes that you have a clean (newly installed) installation of an Ubuntu 16.04 virtual server. According to the official GitLab documentation, it is recommended to have a server with:
- 4 GB of RAM
- 2 CPU cores
This makes our SSD VPS-3 hosting plan suitable for GitLab’s hardware requirements.
If you want to use a local SMTP server you can install postfix by issuing the following command:
sudo apt install postfix
Make sure you select ‘Internet Site’ during the package setup.
Install GitLab
GitLab installation is a straightforward process, as simple as running a few commands. First, you need to add the GitLab repository to your sources list with the following command:
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
The script will also check for needed dependencies and it will install the necessary packages if they are missing.
Once the GitLab repository is added you can install the GitLab package by issuing the following command:
sudo apt install gitlab-ce
The installation will take some time and when it is complete, you will see something as shown below.
gitlab: Thank you for installing GitLab!
Before using the GitLab application, we need to configure it. To start the initial configuration script, run the following command:
sudo gitlab-ctl reconfigure
The configuration will take some time to complete and once it is done you will have a full working GitLab installation with Nginx and Postgres as a database backend.
Open your Gitlab domain (http://my_gitlab.com
) in your web browser and you will be redirected to a password reset screen where you need to enter the administrator password. Make sure to use a strong password. Once you set the password, you will be redirected back to the login screen.
The default administrator username is root. Enter the password you created earlier and click on the “Sign in” button. Once you are logged in you can change the username to whatever you want.
That’s it. You have successfully installed Gitlab on your Ubuntu 16.04 virtual server. For more information about how to manage your Gitlab installation, please refer to the official Gitlab documentation.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.