In order to receive mail notifications, make sure to install a mail server. By default, Archlinux does not ship with one. The recommended mail server is postfix, but you can use others such as SSMTP, msmtp, sendmail, etc.

Configuration

Notes Before Configuring

The gitlab package from AUR organizes GitLab's files in a manner that more closely follows standard linux conventions rather than installing everything in /home/git as you are told to do by GitLab's official install guide.

Another key difference between gitlab from AUR and the GitLab install guide is that GitLab from AUR uses the gitlab user with /var/lib/gitlab as the home folder instead of the git user with /home/git as the home folder. This ensures that /home contains folders managed only by *real* users.

Tip: If you are familiar with the Arch Build System you can edit the PKGBUILD and relevant files to change gitlab's home directory to a place of your liking.

Basic configuration

Open up /etc/webapps/gitlab/shell.yml and set gitlab_url: to the url where you intend to host GitLab (note the 'http://' and trailing slash). For example, if you will host GitLab at 'yourdomain.com', then it'd look like this:

Open up /etc/webapps/gitlab/gitlab.yml and edit where needed. In the gitlab: section set host: (replacing localhost) to 'yourdomain.com', your fully qualified domin name (no 'http://' or trailing slash). port: can be confusing. This is not the port that the gitlab server (unicorn) runs on; it's the port that users will initially access through in their browser. Basically, if you intend for users to visit 'yourdomain.com' in their browser, without appending a port number to the domain name, leave port: as 80. If you intend your users to type something like 'yourdomain.com:3425' into their browsers, then you'd set port: to 3425 (you'll also have to configure your server (apache, nginx, etc) to listen on that port). Those are the minimal changes needed for a working GitLab install. The adventurous may read on in the comment and customize as needed. For example:

Database backend

A Database backend will be required before Gitlab can be run. Currently GitLab supports MariaDB and PostgreSQL. By default, GitLab assumes you will use MySQL. Extra work is needed if you plan to use PostgreSQL.

Note: Don't forget to replace your_username_here and your_password_here with your chosen values in the following examples.

MariaDB

To set up MySQL (MariaDB) you need to create a database called gitlabhq_production along with a user who has full priviledges to the database. You might do it via command line as in the following example.

Now try connecting to the new database with the new user to verify you did it correctly:

mysql -u your_username_here -p -D gitlabhq_production

Next you'll need to open up /etc/webapps/gitlab/database.yml and set username: and password: for the gitlabhq_production database to your_username_here and your_password_here, respectively. You need not worry about the info for the gitlabhq_development and gitlan_test databases, as those are not required for our purposes (unless you're feeling adventurous at your own risk). For example:

For our purposes (unless you know what you're doing), you don't need to worry about configuring the other databases listed in /etc/webapps/gitlab/database.yml. We only need to set up the production database to get GitLab working.

Finally, open up /usr/lib/systemd/system/gitlab.target change all instances of mysql.service to postgresql.service. For example:

Now edit config/unicorn.rb and add a listening port by uncommenting the following line:

listen "127.0.0.1:8080"

Tip: You can set a custom port if you want. Just remember to also include it in Apache's virtual host. See below.

Create a virtual host for Gitlab

Create a configuration file for Gitlab’s virtual host and insert the lines below adjusted accordingly. For the ssl section see LAMP#SSL. If you do not need it, remove it. Notice that the SSL virtual host needs a specific IP instead of generic. Also if you set a custom port for Unicorn, do not forget to set it at the BalanceMember line.

Enable host and start unicorn

Useful Tips

Fix Rake Warning

When running rake tasks for the gitlab project, this error will occur: fatal: Not a git repository (or any of the parent directories): .git. This is a bug in bundler, and it can be safely ignored. However, if you want to git rid of the error, the following method can be used:

Running GitLab with rvm

Note: Version 1.9.3 is currently recommended to avoid some compatibility issues.

For the complete installation you will want to be the final user (e.g. git) so make sure to switch to this user and activate your rvm:

su - git
source "$HOME/.rvm/scripts/rvm"

Then continue with the installation instructions from above. However, the systemd scripts will not work this way, because the environment for the rvm is not activated. The recommendation here is to create to separate shell scripts for puma and sidekiq to activate the environment and then start the service: