How To Install Gerrit on an Ubuntu 14.04 server .

How To Install Gerrit on an Ubuntu 14.04 server .

About Gerrit

  • Gerrit is a code review tool that allows developers to push code to an authoritative repository where it can be looked over before being pushed into the production.
  • The application is very synchronized with git. Because of its utility, there are a variety of ways to build out a strong and secure gerrit platform, including using MySQL or Postgres instead of the default H2 database, configuring gerrit behind another webserver, and customizing the authentication used to login (the default is open_id).

This tutorial will cover install gerrit and explanation that allows you to just get gerrit up and running as quickly as possible on ubuntu server.

Installation steps below :

Step 1- Server Update:

# sudo apt-get update

Step 2- git install :gerrit requires git to be installed on the server.

# sudo apt-get install git

After install to verfiy the commend :

# git –version

Step 3-Install java :gerrit requires Java to be installed on the server.

# sudo apt-get install default-jdk

After install to verfiy the commend :

# java -version

Once Git and Java have been installed on our server, we can start to set up gerrit.

The program itself is hosted on the Google Code site, but the latest version is 2.7

Step 4-Install gerrit :gerrit war file need to download on the server.

# wget

Additionally, while by default, gerrit is set up within the user’s home directory, you can set up the specific directory where the files should be placed by adding (–d) to the line.

# java -jar gerrit-2.7-rc1.war init –batch -d ~/gerrit_example

Once Gerrit has been set up, you can start to access it with your desired user.

Gerrit can be accessed through URL, run below commend to visible in the settings and easy to find the gerrit url in commend itself .

# git config -f ~/gerrit_example/etc/gerrit.config gerrit.canonicalWebUrl

example result:


You can change the gerrit settings in the gerrit.config file.

# vi ~/gerrit_example/etc/gerrit.config

Be sure to restart gerrit after making changes:

# ~/gerrit_example/bin/ restart

If you see localhost in your URL, you should be able to access gerrit through the server’s IP address.


Thanks for reading my blog , like our blog:

My Blog:

Please post your queries ?.

Leave a Reply