How to install gitlab 10.5.7 on Ubuntu 18.04  

To install Gitlab 10.5.7 on Ubuntu 18.04

GitLab is an open source application used to code, test and deploys code together. It provides the Git repository management with access controls, code reviews, issue tracking, and activity feeds. It is so simple to install Gitlab on Ubuntu 18.04, the newly released Ubuntu version. And this tutorial covers the method to install Gitlab on Ubuntu 18.04.

Installing Gitlab

First, install the necessary packages required for the installation by making use of the following command.

root@linuxhelp:~# apt-get install openssh-server postfix -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ncurses-term openssh-sftp-server ssh-import-id
Suggested packages:
.
.
Created symlink /etc/systemd/system/sshd.service &rarr  /lib/systemd/system/ssh.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service &rarr  /lib/systemd/system/ssh.service.
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for systemd (237-3ubuntu6) ...
Processing triggers for rsyslog (8.16.0-1ubuntu10) ...
Processing triggers for ufw (0.35-5) ...
Processing triggers for libc-bin (2.27-0ubuntu2) ...


Once it is done, you shall download Gitlab. There are basically two or more ways to install any package in a Linux operating system namely source installation, adding repo list and installing a Debian package as Ubuntu 18.04 is a new release we try installing a Debian package after downloading it from the official site.

root@linuxhelp:~# wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/xenial/gitlab-ce_10.5.7-ce.0_amd64.deb/download.deb


After downloading you can install by using the following command.

root@linuxhelp:~/Desktop# dpkg -i gitlab-ce_10.5.7-ce.0_amd64.deb 
Selecting previously unselected package gitlab-ce.
(Reading database ... 129212 files and directories currently installed.)
Preparing to unpack gitlab-ce_10.5.7-ce.0_amd64.deb ...
Unpacking gitlab-ce (10.5.7-ce.0) ...
Setting up gitlab-ce (10.5.7-ce.0) ...
It looks like GitLab has not been configured yet  skipping the upgrade script.
.
. 

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

As you see above we need to configure the URL for the gitlab by editing a gitlab.rb file.

root@linuxhelp:~/Desktop# nano /etc/gitlab/gitlab.rb
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url ' http://www.linuxhelp1.com' 


Now we have to re-configure gitlab and you can do that by using the following command.

root@linuxhelp:~/Desktop# gitlab-ctl reconfigure
Starting Chef Client, version 12.21.31
resolving cookbooks for run list: [" gitlab" ]
Synchronizing Cookbooks:
  - gitlab (0.0.1)
  - postgresql (0.1.0)
  - package (0.1.0)
  - registry (0.1.0)
  - mattermost (0.1.0)
  - consul (0.0.0)
  - gitaly (0.1.0)
  - nginx (0.1.0)
  - letsencrypt (0.1.0)
.
.
Recipe: gitlab::prometheus
  * service[prometheus] action restart
    - restart service service[prometheus]
  * ruby_block[reload prometheus svlogd configuration] action create
    - execute the ruby block reload prometheus svlogd configuration
Recipe: gitlab::postgres-exporter
  * service[postgres-exporter] action restart
    - restart service service[postgres-exporter]
  * ruby_block[reload postgres-exporter svlogd configuration] action create
    - execute the ruby block reload postgres-exporter svlogd configuration

Running handlers:
Running handlers complete
Chef Client finished, 388/554 resources updated in 14 minutes 32 seconds
gitlab Reconfigured!

Now we have successfully configured gitlab on Ubuntu 18.04 and we can access from web browser using the following URL http://ip-address and you will see the following screen.

First, you need to assign a root user password.

And then you have to log in as a root user.

Now we have successfully configured and accessed the Gitlab 10.5.7 on Ubuntu 18.04

Tag : gitlab Ubuntu
FAQ
Q
What is Git in linux?
A
Git is a distributed version control system developed by Junio Hamano and Linus Torvalds.

Git does not use a centralized server.

Git runs on Linux, BSD, Solaris, Darwin, Windows, Android, and other operating systems.
Q
Is there any Alternate for gitlab ?
A
SVN,gogs bitbucket and so on.
Q
what is the RAM requirement for GITLAB server to install?
A
min. 4GB required for this Gitlab server.
Q
when i run git pull command onto my git server i am getting this error git pull origin master From ssh://192.168.7.235:4512/test/project * branch master -> FETCH_HEAD Up
A
It's seems like merge issue on your gitlab server, so you can run below command to clear this issue "git stash".
Q
When i was try to restore a backup in gitlab, it's fails and i am getting this error please help rake aborted! PG::ConnectionBad: could not connect to server: No such file or directory
A
It's probably your gitlab services are went down. While restoring a gitlab backup we need to stop these two services (unicorn & sidekiq) alone, and rest of your gitlab services should be runn