
In this tutorial, we are going to show you how to install GitLab on your Ubuntu 20.04 VPS. Gitlab is a platform with a wide range of features that cover the application’s life cycle. It uses Git repository manager for version control so you can easily host your Git repositories, it also offers a CI/CD integration as well as code review.
In collaboration with your team, you can easily plan, build, secure and deploy software much faster and more efficiently. This makes Gitlab a perfect option for DevOps and DevSecOps projects of any scale with a choice of creating, importing, or using templates for new projects.
Table of Contents
Prerequisites
Before we start with the installation there are a few requirements that need to be fulfilled:
- A VPS with at least 4GB of RAM (Our SSD 4 VPS plan)
- Fresh install of Ubuntu 20.04
- User privileges: root or non-root user with sudo privileges
- Pointed A record of domain or subdomain to your server IP address
Step 1. Update the System
Fresh installation of Ubuntu 20.04 requires the latest software updates. Execute the following command to update the system to its latest version:
Step 2. Install dependencies
After you update the system, you should now install the needed dependencies for the Gitlab installation.
Next, you need to install postfix for the notification emails that you would be sent from GitLab. Note, you should have a domain or subdomain pointed to your server before continuing with the installation.
If the configuration screen appears during the installation you can select the ‘Internet site’ option and enter the external DNS ‘mail name’ of your server in the next screen. For the next options, you can use the defaults by pressing enter.
Step 3. Install GitLab
If the previous installations were successful you now continue with your installation by adding the GitLab package repository with the following command.
You are now ready to install GitLab, but before continuing, make sure again that you set up the DNS correctly for your domain or subdomain because you will be using it for the automatic installation. You can now run your GitLab installation with the command.
Note that you should change the EXTERNAL_URL value with your domain or subdomain that you previously set up before starting the installation. During the installation, GitLab will automatically request a certificate from Let’s Encrypt if you used https:// in the EXTERNAL_URL value, you can also install with HTTP or use your own certificate.
A random password will be generated for the root user during the installation, you can find the path for the password file at the end of the installation. Usually, you should be able to find the password file at /etc/gitlab/initial_root_password
. Remember that this password will be stored only for 24 hours.
After the installation is finished you can check the service status with the command.
And you should get similar output if all the services are running.
Now you should be able to access your GitLab application from your browser with the domain or subdomain that you previously set up.
You can log in with root and the randomly generated password from /etc/gitlab/initial_root_password
.
You can start, stop or restart all the GitLab components with the following commands.
You can also start, stop or restart individual components of GitLab. For example, if you want to restart grafana you can do that with the following command.
By default, GitLab will allow new user signups, for secure access it is advised to disable it. You can disable it from the GitLab web console – Menu > Admin -> Uncheck the Sign-up enabled box.
Of course, you don’t have to install GitLab on Ubuntu 20.04. If you find it difficult, by using our Linux hosting plans, you can simply ask our expert Linux admins to install GitLab on Ubuntu 20.04 for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post on how to install GitLab on Ubuntu 20.04, please share it with your friends on the social networks using the buttons below or simply leave a reply. Thank you.