summaryrefslogtreecommitdiffstats
path: root/Documentation/linux-quickstart.txt
blob: ee7fb169739c78b9d1ca39e327d397e6e8d70df0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
= Quickstart for Installing Gerrit on Linux

This quickstart shows you how to install Gerrit on a Linux machine.

[NOTE]
====
The installation steps provided in this quickstart are for
demonstration purposes only. They are not intended for use in a production
environment.

For a more detailed installation guide, see
link:install.html[Standalone Daemon Installation Guide].
====

== Before you begin

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
+
Gerrit is not compatible with Java 9 or newer yet.

== Download Gerrit

From the Linux machine on which you want to install Gerrit:

. Open a terminal window.
. Download the Gerrit archive. See
link:https://gerrit-releases.storage.googleapis.com/index.html[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
....

NOTE: If you want to build and install Gerrit from the source files, see
link:dev-readme.html[Developer Setup].

== Install and initialize Gerrit

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
  link:config-gerrit.html[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
  link:dev-readme.html[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.

== Update the listen URL

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'
....

== Restart the Gerrit service

You must restart the Gerrit service for your authentication type and listen URL
changes to take effect.

....
~/gerrit_testsite/bin/gerrit.sh restart
....

== Viewing Gerrit

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
....

== Next steps

Through this quickstart, you now have a simple version of Gerrit running on your
Linux machine. You can use this installation to explore the UI and become
familiar with some of Gerrit's features. For a more detailed installation guide,
see link:install.html[Standalone Daemon Installation Guide].

GERRIT
------

Part of link:index.html[Gerrit Code Review]

SEARCHBOX
---------