“In this post, I’ll share quick steps to install Gitlab on Ubuntu 16.04 and how to configure it as well.”
What is Gitlab?
Gitlab is an open source GIT repository manager based on Ruby on Rails and developed by Gitlab Inc. This web-based application is used to host Git Repositories that help the development team to keep a track of code, analyze project modifications and includes a number of development related features.
Some of the features like a wiki, issue tracking, code reviews, activity feed and merge management allow for quick deployment of the project. Gitlab has the potential to host multiple projects. You can host Gitlab on your own infrastructure and use it to create an internal repository for your development team.
Also, you can use it to interact with other users publicly or as a mechanism to let other users contribute their projects.
You can even create n number of users on your Gitlab instance and add or remove existing projects as per your requirement.
Let’s look into quick features of Gitlab before we begin the installation process.
Features of Gitlab
- Provides a user-friendly interface for managing multiple projects, keep source code logs, edit files, and create merge requests.
- It can help you manage smaller tasks and greater milestones by setting a deadline for smaller tasks and group-level milestones for various projects.
- The issue boards in Gitlab helps the development team manage any internal or external issues efficiently. It helps to keep track of new and relevant issues in a group in a user-friendly manner. Further, you can create confidential issues that can only be seen with members having Reporter level access and above.
- Group interaction was never this easy. Using Gitlab Omnibus, you can integrate Mattermost for a higher level of team interaction instantly.
- Gitlab offers a wide variety of reporting tools and commit graphs for collaboration projects.
- You can choose the way you get notified using emails, slacks or even to-do lists whenever there is any modification in issues or merge requests.
- You can kickstart a new project with predefined templates with some example code and preconfigured CI.
- With Gitlab CI, you can deploy your project (website or web app) fairly quickly at no additional cost.
Gitlab CE offers a raft of features for your development team to make your work more efficient, quicker and reliable.
Now, let’s quickly go through the prerequisites for Gitlab on Ubuntu 16.04.
- 4GB Internal Memory (RAM)
- A server with 2 Cores (CPU resources)
In this guide, I’ll assume you already have Ubuntu 16.04 installed on your system and have the prerequisites for the Gitlab installation.
Let’s proceed to the next step.
Steps For Installing Gitlab on Ubuntu 16.04
1. Installing Dependencies
First, you’ll have to install the necessary software required for installing, configuring and running Gitlab on Ubuntu 16.04. With Ubuntu, all the necessary software can be easily installed using the apt-get command.
Foremost, refresh the local package index using the below command
$ sudo apt-get update
Now, install the dependencies using the following command:
$ sudo apt-get install ca-certificates curl openssh-server postfix
There is a possibility that most of the software may be preinstalled on your system. Please note for postfix installation, you’ll receive a prompt. Select Internet Site and configure how the system will send an email by typing your server’s domain name or IP address.
The next step is fairly simple and easy. We’ll download an existing installation script which will automatically install the Gitlab on your Ubuntu system.
Download the script using the command below:
cd /tmp curl -LO https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh $ less /tmp/script.deb.sh
Now, run the installer using the command below. It will run the script to setup your server to manage the Gitlab repositories. The main advantage of this script is that you will be able to use the same package management tools for Gitlab which you use for other system packages.
$ sudo bash /tmp/script.deb.sh
Next, install the Gitlab application using apt command
$ sudo apt-get install gitlab-ce
With this command, Gitlab will be installed on your system. Now, we’ll run the command to reconfigure Gitlab before using the actual application.
$ sudo gitlab-ctl reconfigure
This command will initialize the Gitlab using your server information. It is a completely automated process which may take a few minutes.
Allowing HTTP Access in Firewall Settings
Before you access the Gitlab application, you’ll have to allow HTTP access in firewall settings to enable normal web traffic. Start with the command below to check the status of ufw firewall in your system.
$ sudo ufw status
In the terminal, you’ll see only SSH traffic is allowed and other services are restricted by default. However, because Gitlab is a web application, we’ll have to enable HTTP access.
$ sudo ufw allow http $ sudo ufw allow OpenSSH
This command will allow HTTP access in firewall settings. Now, you’ll be easily able to access the Gitlab application on your Ubuntu.
Let’s start with the basics…
Gitlab Configuration on Ubuntu 16.04
Open your web browser and visit your gitlab server using the below command.
Here, you’ll mention the domain name of your Gitlab server.
On your initial visit, you’ll be prompted to set up an admin password. Enter and then re-enter the password. Then click Change Your password to proceed.
Now, you’ll be redirected to the Gitlab login page.
Enter your username and password to log in. Your username by default is root and the password is the one you set up earlier.
Once you enter the right credentials, click Sign In.
You’ll be brought to another page where you can add a new project or create a group, to begin with Gitlab.
You can also modify your profile according to your requirement.
Let me get you started with a simple example.
How to Adjust Your Profile Settings in Gitlab?
- On the top-right corner of the screen, select your profile icon.
- Select Profile Settings from the drop-down menu.
- You’ll be brought to a new page where you can change your avatar, username, email and other settings.
- For beginners, change your username and email to something more concrete than the default settings.
Once done, click on Update Profile Settings and click on the confirmation email you’ll receive in your inbox. Now, you can access Gitlab to start new projects or add new group members to coordinate on your projects and perform tasks collaboratively in an easier manner.
How to Install Gitlab on Ubuntu 16.04: In Summary
Gitlab CE is a free web application to manage your existing projects and create new ones with better efficiency using integrated development tools and pre-designed templates and deploy your websites or web app within a concrete deadline right from Gitlab itself.
I hope you found this article useful. In case I missed on something, share in the comment section below.
For more articles, stay updated with Freaksense.