summaryrefslogtreecommitdiffstats
path: root/Documentation/linux-quickstart.txt
blob: bfebc6a2ddd370698a74af26b15b6453f30eaf3e (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
= Quickstart for Installing Gerrit on Linux

This content explains how to install a basic instance of Gerrit on a Linux
machine.

[NOTE]
====
This quickstart is provided for demonstration purposes only. The Gerrit instance
they install must not be used in a production environment.

Instead, to install a Gerrit production environment, see
link:install.html[Standalone Daemon Installation Guide].
====

== Before you start

Be sure you have:

. A Unix-based server, including any Linux flavor, MacOS, or Berkeley Software
    Distribution (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 desired Gerrit archive.

To view previous archives, see
link:https://gerrit-releases.storage.googleapis.com/index.html[Gerrit Code Review: Releases]. The steps below install Gerrit 2.15.1:

....
wget https://www.gerritcodereview.com/download/gerrit-2.15.1.war
....

NOTE: To build and install Gerrit from the source files, see
link:dev-readme.html[Gerrit Code Review: Developer Setup].

== Install and initialize Gerrit

From the command line, enter:

....
java -jar gerrit*.war init --batch --dev -d ~/gerrit_testsite
....

This command takes two parameters:

* `--batch` assigns default values to several Gerrit configuration
    options. To learn more about these options, see
    link:config-gerrit.html[Configuration].
* `--dev` configures the Gerrit server to use the authentication
  option, `DEVELOPMENT_BECOME_ANY_ACCOUNT`, which enables 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[Gerrit Code Review: Developer Setup].

While this command executes, status messages are displayed in the terminal
window. For example:

....
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 confirms that the Gerrit service is running:

`Starting Gerrit Code Review: OK`.

== Update the listen URL

To prevent outside connections from contacting your new Gerrit instance
(strongly recommended), change the URL on which Gerrit listens from `*` to
`localhost`. For example:

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

To view your new basic installation of Gerrit, go to:

....
http://localhost:8080
....

== Next steps

Now that you have a simple version of Gerrit running, use the installation to
explore the user interface and learn about Gerrit. For more detailed
installation instructions, see
link:[Standalone Daemon Installation Guide](install.html).

GERRIT
------

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

SEARCHBOX
---------