How to install GitLab on CentOS 7

GITLAB
      Gitlab is a popular git repository hosting application. It is a great way to manage git repositories on a centralized server. GitLab gives you complete control over your repositories or projects and allows you to decide whether they are public or private for free
GitLab - Logo
PREREQUISITES
  • User with sudo permission
  • Recommend at least 4GB of free memory to run GitLab
SYSTEM UPDATE 
       Before installing any packages in CentOS, it is recommended to update the system by running the following commands
  • sudo yum -y install epel-release
  • sudo yum -y update
  • sudo shutdown -r now
INSTALLATION
      Gitlab provides Omnibus packages to install. Omnibus is a way to package different services and tools required to run GitLab so that users can install it without hard configuration.
  • Install and configure the dependencies. The commands below will also open HTTP and SSH access in the system firewall.
sudo yum install -y curl policycoreutils openssh-server openssh-clients  

sudo systemctl enable sshd 

sudo systemctl start sshd 

sudo firewall-cmd --permanent --add-service=http 

sudo systemctl reload firewall
  • Add the GitLab package repository
curl –sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
        (If you are behind the proxy means, set your proxy first)
  • Install the GitLab package using yum
sudo yum install -y gitlab-ce
         Wait for some time to install it. A log is displayed, which includes green and grey lines.
  • Configure the gitlab
sudo gitlab-ctl reconfigure
  • Gitlab's configuration file can be found in /etc/gitlab/gitlab.rb. Open it with your text editor
nano  /etc/gitlab/gitlab.rb 
Find the line which contains external_url '<domain_name>’
Uncomment the external_url and give your domain
GitLab’s default set of configuration file is available over here
After you make any configuration changes in the /etc/gitlab/gitlab.rb, make sure to run the command sudo gitlab-ctl reconfigure
Browse to the hostname and login
Browse to the hostname which you gave in the external_url in the gitlab config file. Gitlab’s default User Name is root & Password is 5iveL!fe
Now your own gitlab server is ready to be accessed by the URL you configured in external_url.
OTHER COMMANDS
sudo gitlab-ctl status -> Check the status of gitlab service
sudo gitlab-ctl restart -> Restart the gitlab service 
sudo gitlab-ctl stop -> Stop the service
REFERENCES
https://about.gitlab.com/installation/#centos-7
http://docs.gitlab.com/omnibus/manual_install.html

Comments