Install Hyperledger Fabric on Ubuntu 18.04.1 – Step by Step

Posted on Updated on

Installation of Hyperledger Fabric on Ubuntu is very straight forward and is a step-by-step process. We can majorly divide this whole process into two major parts: First we need to install all pre-requisites and then we proceed towards installation of Fabric itself.

Installing Prerequisites for Hyperledger Fabric:

  • CURL
  • GO Programming Language with setup of path variable
  • Docker & Docker Compose
  • Node.js Runtime & NPM
To install all these prerequisites run following commands in terminal window one by one, everything should go smooth.

sudo apt-get install curl
sudo apt-get install golang-go
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
sudo apt-get install nodejs
sudo apt-get install npm
sudo apt-get install python
sudo apt-get install docker
curl -fsSL | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo apt-get install docker-compose
sudo apt-get upgrade

Till now the environment is ready to install Hyperledger Fabric, Now we will download fabric samples. To do that run following commands in terminal one by one…

sudo curl -sSL | sudo bash -s 1.1.0
sudo chmod 777 -R fabric-samples

Now go into first-network directory which is inside fabric-samples folder and then we will run generate script that will create certificates and keys for the entities on our first blockchain network. This will also create genesis block (first block on blockchain)

cd fabric-samples/first-network
sudo ./ generate

Bring your first network up by running following command. byfn stands for “Build Your First Network”

sudo ./ up

If everything works fine you should see start screen of fabric network. To bring network down following command is used.
sudo ./ down

One thought on “Install Hyperledger Fabric on Ubuntu 18.04.1 – Step by Step

    […] Installing Hyperledger Fabric on Ubuntu […]

Leave a Reply

Your email address will not be published. Required fields are marked *