There are many competitors in the field of git repository hosting, such as Github, Bitbucket and Gitlab. Those services are great as an hosted service (Github is not free for private repositories). However, if you want to host your own instance and know where your data is, the only free solution is the community edition of Gitlab.
With Gitlab you will get access to almost any feature such as an issue tracker, milestones, groups and projects. Upgrades are per user (and not per pack, like Bitbucket does) and are fairly priced. Gitlab is also great for having developers all around the world in the enterprise version.
How to install Gitlab
First, spin up a new VPS based on CentOS 7 using the VPS manager. Installation of a new VPS will only take a few clicks. Do not forget to remember the root password as we will use this to ssh to the server. Also make sure that the hostname resolves in the IP of the server as this will be used for Gitlab. You can change the name later to a different name.
Run the following commands
yum update -y firewall-cmd --permanent --add-service=http systemctl reload firewalld
Run the following command to install Gitlab:
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash yum install gitlab-ce -y gitlab-ctl reconfigure
Configure root account for Gitlab
Go to the hostname of your server. Gitlab will open with a password recovery page where you can enter the password for the main user account with admin privileges. The default username is root.
Disable open registration
Tips for Gitlab
Now you have running your own Gitlab instance, we recommend that you secure your server with at least a tool like CSF. Furthermore it is important to secure your server with https. Continue with our article about how to install Let’s Encrypt with Gitlab.