Hyperledger Fabric prerequisite

Leo Pechin
2 min readOct 26, 2018

--

This tutorial will show you how to install Hyperledger Fabric prerequisite (docker, docker-compose, golang, nodejs, npm, git) and Hyperledger Fabric binary on Ubuntu.

Source : https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html

Tutorial made with Ubuntu 16.04

Step 1. Install prerequisite :

Install docker & docker-compose :

Source : https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce-1

sudo apt-get updatesudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common

Add docker official PGP key :

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add docker repository :

sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

Update and install docker :

sudo apt-get update
sudo apt-get install docker-ce

Install docker-compose :

sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Allow binary :

sudo chmod +x /usr/local/bin/docker-compose

Test the installation :

docker-composer -v && docker -v

Install golang :

cd $HOME/ && wget https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz &&  tar -xvf go1.11.1.linux-amd64.tar.gz

Set path variable :

export GOPATH=$HOME/gopath
export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin

Install npm & node :

cd ~
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs npm

Install git :

sudo apt-get install git

Step 2. Download Hyperledger Fabric binary :

curl -sSL http://bit.ly/2ysbOFE | bash -s 1.3.0

If you face some permission problem, try with sudo :

sudo curl -sSL http://bit.ly/2ysbOFE | sudo bash -s 1.3.0

All binary are located on fabric-samples/bin :

Done ! You can know start to play with the fabric-sample or deploy your own customized Hyperledger Fabric network :

--

--