HomeLinux

How To Install Gitlab On Server With Ubuntu

How To Install Gitlab On Server With Ubuntu
Like Tweet Pin it Share Share Email

A few weeks ago we learned of the sudden purchase of GitHub by Microsoft. A controversial purchase that many defend as if they had done it or criticize it harshly as if it were the advent of the fall of Free Software. Personally I do not believe or defend either of the two positions but it is true that such news has caused many software developers to abandon the services of Github and look for other alternatives as free as Github before its purchase by Microsoft.

There are many services that are becoming popular, but the vast majority of developers are opting to use GitLab, a free alternative that we can install on our computer with Ubuntu or on a private server that uses Ubuntu as an operating system.

What is GitLab?

But first of all, let’s see what it is exactly. Gitlab is a software version control that uses Git technology. But unlike other services, it incorporates other functions besides Git such as the wikis service and an error tracking system. Everything is licensed under GPL, but it is true that like other types of software such as WordPress or Github itself, anyone can not use Gitlab. Gitlab has a web service that offers two types of accounts to its clientsa free account with free and public repositories and another payment or premium account that allows us to create private and public repositories.

This means that all our data is hosted on servers external to us whose control we do not have, as happens with Github. But Gitlab has a version called Gitlab CE or Community Edition that allows us to install and have a Gitlab environment on our server or computer with Ubuntu, although the most practical thing is to use it on a server with Ubuntu. This software offers the benefits of Gitlab Premium but without having to pay anything for it, since we install all the software on our server and not on another server.

Gitlab, as with the Github service, offers interesting resources such as cloning repositories, the development of static web pages with Jekyll software or a version and code control that will allow us to be informed of whether the software or the revision contains some error or not .

The power of Gitlab is superior to Github, at least as far as service is concerned, if we use it as our server’s own software, the power will depend on the hardware of our server. Something that must be taken into account if what we are going to do is change the Github software for the Gitlab software on our private server.

Also Read: How To Download Adobe Illustrator

What do we need to install GitLab on an Ubuntu server?

To have Gitlab or Gitlab CE on our server, we must first install the dependencies or software that is needed for the software to work properly . For this we open a terminal and write the following:

onesudo apt-get install curl openssh-server ca-certificates postfix -y

Possibly some package like curl will already be in our computer but if it is not, this is a good opportunity to perform the installation.

Installation of GitLab

Now that we have all the dependencies of Gitlab, we have to install the Gitlab CE software, which is public and we can get it through a repository external to Ubuntu . For this we open a terminal and write the following:

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

There is another method that uses an external repository but with the Apt-get software tool. To do this instead of writing the above in the terminal we have to write the following:

onesudo EXTERNAL_URL="http://gitlabce.example.com" apt-get install gitlab-ce

And with this we will have the Gitlab CE software on our Ubuntu server. Now it’s time to make some basic configurations so that it works correctly.

The first thing we have to do is release certain ports that Gitlab uses and they will be closed and we use a firewall. The ports that we have to open or that Gitlab uses are port 80 and port 443 .

Now, we have to open for the first time the web screen of Gitlab CE, for it we open in our browser the web page http://gitlabce.example.com. This page will be the one of our servers but, to be the first time, we have to change the password that the system has by default. Once we have changed the password, we have to register or login with the new password and the user “root . With this we will have the private Gitlab system configuration area on our Ubuntu server.

Also Read: How To Activate Application Drawer On Huawei Mobile

If our server is for public use, surely we will need to use the https protocol, a web protocol that uses certificates to make web browsing more secure. We can use any certificate but Gitlab CE does not automatically change the url address of the repository, to do this we have to do it manually, so we edit the file /etc/gitlab/gitlab.rb and in external_URL we have to change the old address for the new one , in this case it will be adding the letter “s”, but we can also make the url different and increase the security of our web server. Once we save and close the file, we must write the following in the terminal so that the changes made are accepted:

onesudo gitlab-ctl reconfigure

This will make all the changes we make to the Gitlab software apply and that are ready for the users of this version control system. Now we can use this software without any problem and without paying anything for having private repositories.

Gitlab or GitHub which is better?

At this point, surely many of you will ask what software is best to use or create repositories of our software. If you continue with Github or if you switch to Gitlab. Both use Git and you can easily change or transfer the software created from one repository to another . But I personally recommend to continue with Github if we have it on our server and if we have nothing installed, then yes install Gitlab . The reason for this is because I think that productivity is above all else and changing one software for another whose advantages are almost minimal does not compensate.

The good thing is that both tools are Free Software and if we know how to create a virtual machine, we can test both programs and see which one adapts to us without needing to change or damage our Ubuntu server.

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *