Installing GitLab on CentOS 7
Gitlab is a popular git repository hosting application. You can use it to store versioned copies of code and collaborate with others. It provides a web interface that allows you to view syntax-highlighted code, compare diffs, handle merge requests, etc. It is comparable in many ways to Github, except that you can host Gitlab on your own server.
Preparing to Install
Gitlab provides Omnibus packages to install. These packages combine all of the libraries and dependencies that Gitlab needs in one single package. You do not ever need to update any of these dependencies, you only update the Gitlab package. Because of this, it makes sense to host Gitlab on its own server or virtual machine to isolate it.
Postfix and an OpenSSH server are required to be running.
# yum install postfix openssh-server -y
# systemctl enable sshd
# systemctl start sshd
# systemctl enable postfix
# systemctl start postfix
If you are using iptables (a software firewall) you will need to open port 80 or port 443 if you are going to be installing an SSL certificate.
# firewall-cmd --permanent --add-service=http
# firewall-cmd --permanent --add-service=https
# systemctl reload firewalld
Download the latest version of gitlab using curl.
Note: New versions are released frequently, check https://about.gitlab.com/downloads/archives/ for the latest version.
Install the package.
# rpm -iv gitlab-7.8.4_omnibus.1-1.el7.x86_64.rpm
All of Gitlab's configuration is handled in /etc/gitlab/gitlab.rb.
A full list of configurable values and their default values for GitLab 7.8 can be found here: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/7-8-stable/files/gitlab-config-template/gitlab.rb.template
Only the external_url value is required. Set it to the domain you will be hosting GitLab on.
By default accounts can only be created by an admin user. If you want to allow user sign-ups you can enable it with this setting:
gitlab_rails['gitlab_signup_enabled'] = true
After you have finished editing gitlab.rb have gitlab generate its config files.
# gitlab-ctl reconfigure
Gitlab can now be started:
# gitlab-ctl start
Open the GitLab web interface in your browser by going to the domain specified in gitlab.rb.
The admin username is root and the default password is 5iveL!fe.
Make sure to change the password as soon as you login.
If you have any issues, check out the GitLab readme: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/7-8-stable/README.md