Gitlab Installation on Ubuntu


GitLab is a single application for the entire DevOps lifecycle that allows teams to work together better and bring more value to your customers, faster. GitLab does this by shortening your DevOps cycle time, bridging silos and stages, and taking work out of your hands.

One of the best open source Version Control tool.

Below are the prerequisites features to be present on the version control machine.


sudo apt-get update

sudo apt-get install nodejs
sudo apt-get install npm
sudo apt-get update
sudo apt-get install git
sudo apt-get install subversion

sudo apt-get update

sudo apt-get install ca-certificates curl openssh-server postfix
cd /tmp

Below link is to install community edition. use gitlab-ee in the below link for enterprise edition


curl -LO https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh


less /tmp/script.deb.sh

sudo bash /tmp/script.deb.sh

sudo apt-get install gitlab-ce


Modify the configuration file of Gitlab in the below file for all the settings.

Ports,  link, mail configuration LDAP integration etc. 

vi /etc/gitlab/gitlab.rb



****************Sample piece of gitlab.rb*****************

external-url-for-gitlab
external_url 'http://gitlab-test.mylab.in'


### Email Settings

 gitlab_rails['gitlab_email_enabled'] = true
 gitlab_rails['gitlab_email_from'] = 'noreply-gitlab@mylab.in'
 gitlab_rails['gitlab_email_display_name'] = 'Gitlab'
 gitlab_rails['gitlab_email_reply_to'] = 'noreply-gitlab@mylab.in'
 gitlab_rails['gitlab_email_subject_suffix'] = 'Gitlab Alert!'

### GitLab user privileges

# gitlab_rails['gitlab_default_can_create_group'] = true
 gitlab_rails['gitlab_username_changing_enabled'] = true



###! **Use smtp instead of sendmail/postfix.**


 gitlab_rails['smtp_enable'] = true

 gitlab_rails['smtp_address'] = "mail.mylab.com"
 gitlab_rails['smtp_port'] = 587
 gitlab_rails['smtp_user_name'] = "noreply-gitlab@mylab.in"
 gitlab_rails['smtp_password'] = "mylab@1234"
 gitlab_rails['smtp_domain'] = "mail.mylab.com"
 gitlab_rails['smtp_authentication'] = "login"
 gitlab_rails['smtp_enable_starttls_auto'] = true
 gitlab_rails['smtp_tls'] = false

###! **Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert'**

###! Docs: http://api.rubyonrails.org/classes/ActionMailer/Base.html
 gitlab_rails['smtp_openssl_verify_mode'] = 'peer'

**********************************************************************


To test the mail service use the below code


gitlab-rails console

Notify.test_email('mohammed.adil@mylab.in', 'Message Subject', 'Message Body').deliver_now

Login page :







No comments:

Post a Comment