David Shevitz | 11a458a | 2017-07-20 15:32:05 -0700 | [diff] [blame] | 1 | = Quickstart for Installing Gerrit on Linux |
| 2 | |
| 3 | This quickstart shows you how to install Gerrit on a Linux machine. |
| 4 | |
| 5 | [NOTE] |
| 6 | ==== |
| 7 | The installation steps provided in this quickstart are for |
| 8 | demonstration purposes only. They are not intended for use in a production |
| 9 | environment. |
| 10 | |
| 11 | For a more detailed installation guide, see |
David Shevitz | bcd0d24 | 2017-10-01 02:11:07 -0700 | [diff] [blame] | 12 | link:install.html[Standalone Daemon Installation Guide]. |
David Shevitz | 11a458a | 2017-07-20 15:32:05 -0700 | [diff] [blame] | 13 | ==== |
| 14 | |
| 15 | == Before you begin |
| 16 | |
| 17 | To complete this quickstart, you need: |
| 18 | |
| 19 | . A Unix-based server such as any of the Linux flavors or BSD. |
Gert van Dijk | f1f5f08 | 2018-08-16 11:46:46 +0200 | [diff] [blame] | 20 | . Java SE Runtime Environment version 1.8 |
| 21 | + |
| 22 | Gerrit is not compatible with Java 9 or newer yet. |
David Shevitz | 11a458a | 2017-07-20 15:32:05 -0700 | [diff] [blame] | 23 | |
| 24 | == Download Gerrit |
| 25 | |
| 26 | From the Linux machine on which you want to install Gerrit: |
| 27 | |
| 28 | . Open a terminal window. |
| 29 | . Download the Gerrit archive. See |
| 30 | link:https://gerrit-releases.storage.googleapis.com/index.html[Gerrit Code |
| 31 | Review - Releases] for a list of available archives. |
| 32 | |
| 33 | The steps in this quickstart used Gerrrit 2.14.2, which you can download using |
| 34 | a command such as: |
| 35 | |
| 36 | .... |
| 37 | wget https://www.gerritcodereview.com/download/gerrit-2.14.2.war |
| 38 | .... |
| 39 | |
| 40 | NOTE: If you want to build and install Gerrit from the source files, see |
| 41 | link:dev-readme.html[Developer Setup]. |
| 42 | |
| 43 | == Install and initialize Gerrit |
| 44 | |
| 45 | From the command line, type the following: |
| 46 | |
| 47 | .... |
| 48 | java -jar gerrit*.war init --batch --dev -d ~/gerrit_testsite |
| 49 | .... |
| 50 | |
| 51 | The 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 | |
| 62 | This command displays a number of messages in the terminal window. The following |
| 63 | is an example of these messages: |
| 64 | |
| 65 | .... |
| 66 | Generating SSH host key ... rsa(simple)... done |
| 67 | Initialized /home/gerrit/gerrit_testsite |
| 68 | Executing /home/gerrit/gerrit_testsite/bin/gerrit.sh start |
| 69 | Starting Gerrit Code Review: OK |
| 70 | .... |
| 71 | |
| 72 | The last message you should see is `Starting Gerrit Code Review: OK`. This |
| 73 | message informs you that the Gerrit service is now running. |
| 74 | |
| 75 | == Update the listen URL |
| 76 | |
| 77 | Another recommended task is to change the URL that Gerrit listens to from `*` |
David Shevitz | d2a3aae | 2017-10-01 05:59:51 -0700 | [diff] [blame] | 78 | to `localhost`. This change helps prevent outside connections from contacting |
David Shevitz | 11a458a | 2017-07-20 15:32:05 -0700 | [diff] [blame] | 79 | the instance. |
| 80 | |
| 81 | .... |
David Pursehouse | 53a6742 | 2017-11-04 00:45:15 +0000 | [diff] [blame] | 82 | git config --file ~/gerrit_testsite/etc/gerrit.config httpd.listenUrl 'http://localhost:8080' |
David Shevitz | 11a458a | 2017-07-20 15:32:05 -0700 | [diff] [blame] | 83 | .... |
| 84 | |
| 85 | == Restart the Gerrit service |
| 86 | |
| 87 | You must restart the Gerrit service for your authentication type and listen URL |
| 88 | changes to take effect. |
| 89 | |
| 90 | .... |
| 91 | ~/gerrit_testsite/bin/gerrit.sh restart |
| 92 | .... |
| 93 | |
| 94 | == Viewing Gerrit |
| 95 | |
| 96 | At this point, you have a basic installation of Gerrit. You can view this |
| 97 | installation by opening a browser and entering the following URL: |
| 98 | |
| 99 | .... |
| 100 | http://localhost:8080 |
| 101 | .... |
| 102 | |
| 103 | == Next steps |
| 104 | |
| 105 | Through this quickstart, you now have a simple version of Gerrit running on your |
| 106 | Linux machine. You can use this installation to explore the UI and become |
| 107 | familiar with some of Gerrit's features. For a more detailed installation guide, |
David Shevitz | bcd0d24 | 2017-10-01 02:11:07 -0700 | [diff] [blame] | 108 | see link:install.html[Standalone Daemon Installation Guide]. |
David Shevitz | 11a458a | 2017-07-20 15:32:05 -0700 | [diff] [blame] | 109 | |
| 110 | GERRIT |
| 111 | ------ |
| 112 | |
| 113 | Part of link:index.html[Gerrit Code Review] |
| 114 | |
| 115 | SEARCHBOX |
| 116 | --------- |