How to Install Gerrit on macOS

This tutorial will guide you in installing Gerrit on your macOS computer.

Step 1: Verify OpenJDK Installation

Before installing Gerrit, it is necessary to verify that the OpenJDK is installed in your computer. Run the following commands in your terminal to verify:

$ java -version

Ensure that your terminal outputs a version of OpenJDK greater or equal to version 8.

If you do not have OpenJDK installed, you can install it by running the following command:

$ brew install openjdk

Step 2: Install Gerrit

  1. Go to https://www.gerritcodereview.com/ and download the latest Gerrit release for your operating system.

  2. Unpack the downloaded release. You can do this by running the following command in your terminal, replacing [RELEASE_FILE_NAME] with the name of the downloaded file:

    $ tar -xf [RELEASE_FILE_NAME].tar.gz
    
  3. Move the unpacked Gerrit files to the desired installation directory. You can do this by running the following command:

    $ mv [RELEASE_DIRECTORY] ~/gerrit
    
  4. Change into the newly created Gerrit directory:

    $ cd ~/gerrit
    
  5. Initialize Gerrit by running the following command:

    $ java -jar bin/gerrit.war init -d ~/gerrit_site
    
  6. Follow the on-screen instructions to set up your Gerrit administrator account and the basic configuration of your Gerrit installation.

Step 2: Running Gerrit

To start the Gerrit server, run the following command:

$ java -jar ~/gerrit/bin/gerrit.war daemon -d ~/gerrit_site

You can access the Gerrit web interface by opening your browser and navigating to http://localhost:8080/.

Congratulations! You have successfully installed and started Gerrit on your macOS computer.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!