The people from GitLab have created an Omnibus package for the major Linux distributions (Ubuntu, Debian, and CentOS). These packages are an easy way of installing your GitLab installation, as they have all the dependencies packaged with them.
For this recipe, we are going to use the Ubuntu version of the Omnibus package.
Before we start installing, you need to have a server installed with a Ubuntu 12.04 64-bit system, and have SSH access to the server.
Download the package, change the
X.Y.Zportion to the version you want to download. At the time of writing, 7.3.2 is the latest version:
Install the OpenSSH server:
sudo apt-get install openssh-server
sudo apt-get install postfix
Postfix will ask you what kind of installation you want; choose the Internet Site option.
Enter the fully qualified domain name for the domain you want GitLab to send e-mails from (that is,
Install the Omnibus package, and replace the
X.Y.Zpart with your version:
sudo dpkg -i gitlab_7.3.2-omnibus.5.1.0.ci-1_amd64.deb
Now, we will configure your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure
Check to see whether all the services are running using the following command:
sudo gitlab-ctl status
The output should look like the following screenshot:
You can now log in with the username
root and password
GitLab makes good use of this capability. As you only have to install a mail server and an OpenSSH server, all the other parts are automatically installed for you.
GitLab will auto configure itself with the recommended settings. If you want to change your configuration, you have to first create the configuration file. You can do this as follows:
$ sudo mkdir -p /etc/gitlab $ sudo touch /etc/gitlab/gitlab.rb $ sudo chmod 600 /etc/gitlab/gitlab.rb
The settings that you are most likely to change are the ones that are in the
gitlab.yml file (https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example).
You need to make a small translation change in order to make this work, so let's say you want to change the port that GitLab is running on; normally, you would change the port value in the GitLab file, but now you have to add an entry to
So, for the port, the entry in
gitlab.yml would look like the following code:
production: &base gitlab: port: 80
gitlab.rb file, you need to create the following entry:
gitlab_rails['port'] = 80.