Gitlab is an open source, powerful, robust, scalable, secure, as well as efficient software development and collaboration platform for all stages of the DevOps lifecycle.
It allows you to plan your development process; code, and verify; package software, and release it with an in-built continuous delivery feature; automate configurations management, and monitor software performance.
It has features such as an issue tracker, moving of issues between projects, time tracking, very powerful branching tools, file locking, merge requests, custom notifications, project roadmaps, burndown charts for project and group milestones, and so much more.
Gitlab is one of the best alternatives to Github, that is now owned by Microsoft, for hosting your open source projects.
Here is what you need to do in order to install Gitlab on CentOS:
Install and Configure Required Dependencies
1 |
# yum install curl policycoreutils-python openssh-server |
Install Postfix service to send notification emails, and enable it to start at system boot, then check if its up and running using following commands.
1 2 3 4 |
# yum install postfix # systemctl start postfix # systemctl enable postfix # systemctl status postfix |
During Postfix installation a configuration window may appear. Select ‘Internet Site‘ and use your server’s external DNS for ‘mail name‘ and press enter. If extra screens appear, continue to press enter to accept the defaults.
Add GitLab Repository and Install Package
Add the GitLab package YUM repository to your system by running a following script.
1 |
$ curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash |
Install the GitLab Community Edition package using following command and make sure to change ‘http://gitlab.itgala.xyz’ to the URL at which you want to access your GitLab instance from a web browser.
1 |
# EXTERNAL_URL="http://gitlab.itgala.xyz" yum install -y gitlab-ee |
If you want to change your main URL, you can configure it in the GitLab main configuration file /etc/gitlab/gitlab.rb
in the external_url
section. Once changed, don’t forget to reconfigure Gitlab to apply the recent changes in the configuration file using following command.
1 |
# gitlab-ctl reconfigure |
If you have a system firewall enabled, you need to open port 80 (HTTP) and 443 (HTTPS) to allow connections in the system firewall.
1 2 3 |
# firewall-cmd --permanent --add-service=80/tcp # firewall-cmd --permanent --add-service=443/tcp # systemctl reload firewalld |
Perform Initial Gitlab Setup
Open a web browser and access your Gitlab instance using the following URL you set during installation.
http://gitlab.itgala.xyz
On your first visit, you’ll be redirected to a password reset screen, create a new password for your new admin account and click “Change your password”. Once you set, it will be redirected back to the login screen and login with username root and the password you set.
A successful login should take you into the admin user account. From here, you can create an object, create a group, add people or configure your Gitlab instance as you wish. You can also edit your user profile, configure your email, and add SSH keys to your Gitlab instance, and more.
That’s all for now! Have fun with your new Gitlab server! 🙂