Installing Besu binary on Linux

Ever gotten a "besu command not found" on your terminal? Well, read on...

Although there are many ways to install software on a Linux machine, an accepted startard practice is to install on your Linux user's home/bin folder. The following will help you install Hyperledger Besu on Ubuntu, and can be tweaked to many other distributions.

The Java JDK is a requirement for running Besu. Make sure its already installed and higher than version 11 by typing java --version. If it isn't installed, follow these install instructions or type sudo apt install default-jdk into the terminal.

  1. Download the latest binary from a trusted website (ie. the PegaSys website).

  2. If it doesn't exist, make the home bin folder.

cd ~
mkdir bin
  1. Move the binary to the bin folder. Remember to replace with the name of the file you've downloaded from step 1.
cd ~
cd Downloads
mv <binary-filename> ~/bin
  1. Untar/unzip the downloaded binary. Depending on which file type you've downloaded, choose the extraction type.

If not present in your system, install unzip with sudo apt-get install unzip.

Untar:

cd ~
cd bin
tar xf <binary-filename>.tar.gz

Unzip:

cd ~
cd bin
unzip <binary-filename>.zip
  1. Rename the folder to besu.

You may now remove the original tar/zip file.

mv <besu-version>/ besu

Your bin folder should look like this now:

~/tmp/bin
$ tree -L 2
.
└── besu
    ├── bin
    ├── lib
    ├── LICENSE
    └── license-dependency.html
  1. Add Besu to your PATH environment variable. Adding a binary to your PATH allows you to run the executable from any folder on your machine, without having to point to it directly at each call.

Using your text editor of choice, add the following line to your .bashrc (or .zshrc, etc) file.

PATH=$PATH:~/bin/besu/bin
  1. Restart your terminal.

You should now be able to run Besu from any folder, open a terminal window and type besu -h and you will get the besu help output in the terminal.

Get more information on Besu here:

Docs
Code
Binaries
Wiki
Jira
Web