blob: ee7fb169739c78b9d1ca39e327d397e6e8d70df0 [file] [log] [blame]
David Shevitz11a458a2017-07-20 15:32:05 -07001= Quickstart for Installing Gerrit on Linux
2
3This quickstart shows you how to install Gerrit on a Linux machine.
4
5[NOTE]
6====
7The installation steps provided in this quickstart are for
8demonstration purposes only. They are not intended for use in a production
9environment.
10
11For a more detailed installation guide, see
David Shevitzbcd0d242017-10-01 02:11:07 -070012link:install.html[Standalone Daemon Installation Guide].
David Shevitz11a458a2017-07-20 15:32:05 -070013====
14
15== Before you begin
16
17To complete this quickstart, you need:
18
19. A Unix-based server such as any of the Linux flavors or BSD.
Gert van Dijkf1f5f082018-08-16 11:46:46 +020020. Java SE Runtime Environment version 1.8
21+
22Gerrit is not compatible with Java 9 or newer yet.
David Shevitz11a458a2017-07-20 15:32:05 -070023
24== Download Gerrit
25
26From the Linux machine on which you want to install Gerrit:
27
28. Open a terminal window.
29. Download the Gerrit archive. See
30link:https://gerrit-releases.storage.googleapis.com/index.html[Gerrit Code
31Review - Releases] for a list of available archives.
32
33The steps in this quickstart used Gerrrit 2.14.2, which you can download using
34a command such as:
35
36....
37wget https://www.gerritcodereview.com/download/gerrit-2.14.2.war
38....
39
40NOTE: If you want to build and install Gerrit from the source files, see
41link:dev-readme.html[Developer Setup].
42
43== Install and initialize Gerrit
44
45From the command line, type the following:
46
47....
48java -jar gerrit*.war init --batch --dev -d ~/gerrit_testsite
49....
50
51The preceding command uses two parameters:
52
53* `--batch`. This parameter assigns default values to a variety of Gerrit
54 configuration options. To learn more about these configuration options, see
55 link:config-gerrit.html[Configuration].
56* `--dev`. This parameter configures the server to use the authentication
57 option, `DEVELOPMENT_BECOME_ANY_ACCOUNT`. This authentication type makes it
58 easy for you to switch between different users to explore how Gerrit works.
59 To learn more about setting up Gerrit for development, see
60 link:dev-readme.html[Developer Setup].
61
62This command displays a number of messages in the terminal window. The following
63is an example of these messages:
64
65....
66Generating SSH host key ... rsa(simple)... done
67Initialized /home/gerrit/gerrit_testsite
68Executing /home/gerrit/gerrit_testsite/bin/gerrit.sh start
69Starting Gerrit Code Review: OK
70....
71
72The last message you should see is `Starting Gerrit Code Review: OK`. This
73message informs you that the Gerrit service is now running.
74
75== Update the listen URL
76
77Another recommended task is to change the URL that Gerrit listens to from `*`
David Shevitzd2a3aae2017-10-01 05:59:51 -070078to `localhost`. This change helps prevent outside connections from contacting
David Shevitz11a458a2017-07-20 15:32:05 -070079the instance.
80
81....
David Pursehouse53a67422017-11-04 00:45:15 +000082git config --file ~/gerrit_testsite/etc/gerrit.config httpd.listenUrl 'http://localhost:8080'
David Shevitz11a458a2017-07-20 15:32:05 -070083....
84
85== Restart the Gerrit service
86
87You must restart the Gerrit service for your authentication type and listen URL
88changes to take effect.
89
90....
91~/gerrit_testsite/bin/gerrit.sh restart
92....
93
94== Viewing Gerrit
95
96At this point, you have a basic installation of Gerrit. You can view this
97installation by opening a browser and entering the following URL:
98
99....
100http://localhost:8080
101....
102
103== Next steps
104
105Through this quickstart, you now have a simple version of Gerrit running on your
106Linux machine. You can use this installation to explore the UI and become
107familiar with some of Gerrit's features. For a more detailed installation guide,
David Shevitzbcd0d242017-10-01 02:11:07 -0700108see link:install.html[Standalone Daemon Installation Guide].
David Shevitz11a458a2017-07-20 15:32:05 -0700109
110GERRIT
111------
112
113Part of link:index.html[Gerrit Code Review]
114
115SEARCHBOX
116---------