$ sudo apt-get install git
$ sudo apt-get install default-jdk # OPTIONAL
$ wget https://gerrit-releases.storage.googleapis.com/gerrit-2.15.5.war
$ java -jar gerrit-2.15.war init --batch -d ~/gerrit
https://www.digitalocean.com/community/tutorials/how-to-install-gerrit-on-an-ubuntu-cloud-server