{% include important.html content=“This content is currently in alpha. It is still under review.” %}
This quickstart shows you how to install Gerrit on a Linux machine.
{{site.data.alerts.note}}
To complete this quickstart, you need:
A Unix-based server such as any of the Linux flavors or BSD.
Java SE Runtime Environment version 1.8 or later.
From the Linux machine on which you want to install Gerrit:
Open a terminal window.
Download the Gerrit archive. See Gerrit Code Review - Releases for a list of available archives.
The steps in this quickstart used Gerrrit 2.14.2, which you can download using a command such as:
wget https://www.gerritcodereview.com/download/gerrit-2.14.2.war
From the command line, type the following:
java -jar gerrit*.war init --batch --dev -d ~/gerrit_testsite
The preceding command uses two parameters:
--batch
. This parameter assigns default values to a variety of Gerrit configuration options. To learn more about these configuration options, see Configuration.
--dev
. This parameter configures the server to use the authentication option, DEVELOPMENT_BECOME_ANY_ACCOUNT
. This authentication type makes it easy for you to switch between different users to explore how Gerrit works. To learn more about setting up Gerrit for development, see Developer Setup.
This command displays a number of messages in the terminal window. The following is an example of these messages:
Generating SSH host key ... rsa(simple)... done Initialized /home/gerrit/gerrit_testsite Executing /home/gerrit/gerrit_testsite/bin/gerrit.sh start Starting Gerrit Code Review: OK
The last message you should see is Starting Gerrit Code Review: OK
. This message informs you that the Gerrit service is now running.
Another recommended task is to change the URL that Gerrit listens to from *
to localhost
. This change helps prevent outside connections from contacting the instance.
git config --file gerrit_testsite/etc/gerrit.config httpd.listenUrl 'http://localhost:8080'
You must restart the Gerrit service for your authentication type and listen URL changes to take effect.
~/gerrit_testsite/bin/gerrit.sh restart
At this point, you have a basic installation of Gerrit. You can view this installation by opening a browser and entering the following URL:
http://localhost:8080