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.
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 clients: a 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:
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:
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:
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
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:
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.