Posted by: sutrisno | October 30, 2014

GitlabHQ on Ubuntu 14.04

GitlabHQ on Ubuntu 14.04

Screenshot - 10302014 - 09:20:15 PM

#apt-get update
#apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev
# python –version
Python 2.7.6

mkdir /tmp/ruby && cd /tmp/ruby
tar zxvf ruby-2.1.2.tar.gz
cd ruby-2.1.2
sudo make install

# ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]

# gem install bundler –no-ri –no-rdoc
Fetching: bundler-1.6.5.gem (100%)
Successfully installed bundler-1.6.5
1 gem installed

#adduser –disabled-login –gecos ‘GitLab’ git

cd /home/git
sudo -u git -H git clone
cd gitlab-shell
sudo -u git -H git checkout v1.7.0
sudo -u git -H cp config.yml.example config.yml

sudo vi config.yml
# GitLab user. git by default
user: git

# Url to gitlab instance. Used for api calls. Should end with a slash.
#gitlab_url: “http://localhost/”
gitlab_url: “”


# sudo -u git -H ./bin/install
mkdir -p /home/git/repositories: true
mkdir -p /home/git/.ssh: true
chmod 700 /home/git/.ssh: true
touch /home/git/.ssh/authorized_keys: true
chmod 600 /home/git/.ssh/authorized_keys: true
chmod -R ug+rwX,o-rwx /home/git/repositories: true
find /home/git/repositories -type d -print0 | xargs -0 chmod g+s: true

sudo apt-get install mariadb-server mariadb-client libmariadbclient-dev

mysql -u root -p
GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON gitlabdb.* TO ‘gitlabuser’@’localhost’ IDENTIFIED BY ‘gitlabuserpassword’;
flush privileges;

cd /home/git
sudo -u git -H git clone gitlab
cd /home/git/gitlab
sudo -u git -H git checkout 6-0-stable
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml

sudo -u git -H vi config/gitlab.yml

## GitLab settings
# gitlab:
# ## Web server settings
# host: localhost
# port: 80
# https: false

## Web server settings
port: 80
https: false

cd /home/git/gitlab
chown -R git log/
chown -R git tmp/
chmod -R u+rwX log/
chmod -R u+rwX tmp/
sudo -u git -H mkdir /home/git/gitlab-satellites
sudo -u git -H mkdir tmp/pids/
sudo -u git -H mkdir tmp/sockets/
chmod -R u+rwX tmp/pids/
chmod -R u+rwX tmp/sockets/
sudo -u git -H mkdir public/uploads
chmod -R u+rwX public/uploads
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
sudo -u git -H git config –global “GitLab”
sudo -u git -H git config –global “gitlab@localhost”
sudo -u git -H git config –global core.autocrlf input
sudo -u git cp config/database.yml.mysql config/database.yml

sudo -u git -H vi config/database.yml

# adapter: mysql2
# encoding: utf8
# reconnect: false
# database: gitlabhq_production
# pool: 10
# username: root
# password: “secure password”

adapter: mysql2
encoding: utf8
reconnect: false
database: gitlabdb
pool: 10
username: gitlabuser
password: “gitlabuserpassword”

sudo -u git -H chmod o-rwx config/database.yml

cd /home/git/gitlab
gem install charlock_holmes –version ‘’

apt-get install openssh-server
apt-get install postfix # Select ‘Internet Site’,

sudo dpkg -i gitlab_7.1.1-omnibus-1_amd64.deb

vi /etc/gitlab/gitlab.rb

#external_url ‘’
external_url ‘’

#gitlab-ctl reconfigure

You can browse the login page at use the credentials as username=root and password=5iveL!fe


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: