Setup a Hyperledger Fabric Host and Create a Machine Image


Launch an EC2 Instance

Install Prerequisite components for Hyperledger Fabric

ssh -i <key> ubuntu@<public_ip>
sudo apt-get update

Install cURL

sudo apt install curl

Install docker and docker-compose

sudo apt-get -y install docker-compose
sudo usermod -aG docker $USER
docker -v
docker-compose -v

Install Go Programming Language

sudo tar -xvf go1.11.11.linux-amd64.tar.gz
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

Install Node.js and NPM

curl -sL | sudo bash -
sudo apt install nodejs
node -v
npm -v

Install Python

Install Hyperledger Fabric Components


curl -sSL | bash -s 1.4.1


docker images
cd fabric-samples/first-network
./ up
./ downexit

Create an AMI on this Host

Launch an EC2 instance with our AMI

// should have no running containers
docker ps
// hyperledger fabric docker images are all there
docker images
cd fabric-samples/first-network// wait till whole script complete
./ up
// tear down the first network and chaincode
./ down


Visit for all my works. Reach me on or follow me @kctheservant in Twitter.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store