Installing GitLab 5 on CentOS 6.2

You now have no excuses to not be using git for your projects.
Beside great FREE git hosting services and paid self hosted solutions like github and bitbucket there is also the option to go self hosted for FREE

You can have full control over your servers and environment and only allow access to your projects to the people involved in it.

GitLabs is a full fledged open source self hosted git management solution.

The installation of gitlabs is very straight forward.
Here are the steps that I followed:

1. Download

The folks at gitlabs published a script to install gitlabs on Ubuntu but not on CentOS.
However, thanks to Mattias Ohlsson, that compiled all the notes about how to install gitlabs on cento, now there is a script that installs from begin to end gitlabs on centos.
You can find the script here:
Or try the steps manually following these notes:

So the commands you need to run are:


*I edited the file and set the mysql password manually instead of leaving up to the script to create one. If you don’t care about the mysql pass just leave the script the way it is that later it will spit out which password it chose for the mysql db

2. Install

chmod +x HOSTNAME=yourhostnamehere ./

It will take a few mins and after it is done you will have a working version of gitlabs on your machine.

3. Fix issues

The only problem I had was with the path to ruby. The script completed fine, without any errors. However, when I tried to push a repo to the new server I got this error message:

/usr/bin/env: ruby: No such file or directory

The server was not finding the path to ruby.
To solve it I just added ruby to the $PATH.

 cat > /etc/profile.d/ << EOF  
 export PATH=/usr/local/rvm/src/ruby-1.9.3-p392:$PATH  
 export PATH=/usr/local/rvm/src/ruby-1.9.3-p392/bin:$PATH  

source /etc/profile.d/

After running the commands above you should be able to push without any trouble to your gitlab server.