How to install GitLab on ClearOS


This GitLab installation documented here is still hacky. At the end of the step-by-step process below. This setup has not been used in production.


Gitlab strongly recommends at least 4GB of free memory to run GitLab.

Install package

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo os=el dist=7 bash

The os=el and dist=7 environment variables are necessary for the installation to work, as the detected "clearos" OS is not supported.

yum -y install gitlab-ce


There are two network setups. Tasiest one is to run Gitlab in a different port than 80, with a dedicated Nginx server. Another option is to disable the webserver and configure Apache to serve the requests.

Either way, you'll start by editing /etc/gitlab/gitlab.rb

cd /etc/gitlab
vi gitlab.rb

After editing this file, the command gitlab-ctl reconfigure will apply changes and deploy Gitlab.

Using new server in a different port

Change you external_url to point to your domain. You need to choose a port number

external_url 'http://yourdomain.com:82

Deploy the application

gitlab-ctl reconfigure

Using existing Apache

First, disable nginx and setup a TCP port for Apache to connect to.

nginx['enable'] = false
web_server['external_users'] = ['apache']
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = ""

Deploy the application

gitlab-ctl reconfigure

TODO: How to properly configure Apache in a ClearOS way?

Configure https

HTTPS instructions can be found here for nginx. If you run without https, disable redirection from http to https at gilab.rb.

nginx['redirect_http_to_https'] = false

Apply changes

gitlab-ctl reconfigure