How to install GitLab on linux

In this tutorial, How to install Gitlab on Linux such as centos server and ubuntu server. To use Gitlab CE or Community Edition is open sources. It’s a git repository, Gitlab server like GitHub server. The commands as below running root account.

The steps installing Gitlab server as below:

  • SSH client connects to Gitlab server
  • To install the package dependencies and installing Gitlab CE
  • The firewall has to open port for Gitlab server

The hardware requirements for Gitlab server:

  • 2 cores4GB
  • of RAM

Gitlab on Centos server

To install package dependencies for centos server

# yum update -y
# yum install curl openssh-server postfix -y

Note: The during Postfix installation, to select Internet Site when prompted.

To install Gitlab CE on Centos server

# cd /opt/
# curl -O
# sh
# yum -y install gitlab-ce
# gitlab-ctl reconfigure

Gitlab on ubuntu server

To install package dependencies for ubuntu server

# apt-get update -y
# apt-get install curl openssh-server postfix -y

Note: The during Postfix installation, to select Internet Site when prompted.

To install Gitlab CE server on ubuntu server

# cd /opt/
# curl -O
# bash
# apt-get install gitlab-ce
# gitlab-ctl reconfigure

How to change password root default for Gitlab server. The problem, when first login “Invalid login or password” on Gitlab server. This problem solved!

# gitlab-rake gitlab:setup RAILS_ENV=production GITLAB_ROOT_PASSWORD=123456789

The finish, To installed Gitlab CE Server, the first login
From the browser you access to links:  “http://gitlab_domain_or_IP” and then login with a “root” user and with initial password “5iveL!fe. (in this tutorial, to the changed password for root is 123456789)

To restart service for Gitlab server

# gitlab-ctl restart

The output below:

 ok: run: gitaly: (pid 18182) 1s
 ok: run: gitlab-monitor: (pid 18190) 0s
 ok: run: gitlab-workhorse: (pid 18193) 1s
 ok: run: logrotate: (pid 18201) 0s
 ok: run: nginx: (pid 18210) 0s
 ok: run: node-exporter: (pid 18212) 0s
 ok: run: postgres-exporter: (pid 18232) 0s
 ok: run: postgresql: (pid 18241) 0s
 ok: run: prometheus: (pid 18251) 0s
 ok: run: redis: (pid 18256) 1s
 ok: run: redis-exporter: (pid 18261) 0s
 ok: run: sidekiq: (pid 18273) 0s
 ok: run: unicorn: (pid 18278) 1s

To check status Nginx

# gitlab-ctl status nginx

The output below:

 run: nginx: (pid 18210) 55s; run: log: (pid 12818) 2487s


Thought this article, you have installed Gitlab server on Linux with distros centos or ubuntu server. I hope this will be helpful for you! Thank you for reading the DevopsRoles page!

, , ,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.