Prerequisites

The following prerequisites are required to run a Docker-based Fabric test network on your local machine.

Mac

Homebrew

For macOS, we recommend using Homebrew to manage the prereqs.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew --version # => Homebrew 2.5.2

The Xcode command line tools will be installed as part of the Homebrew installation. Once Homebrew is ready, installing the necessary prerequisites is very easy:

Git

Install the latest version of git if it is not already installed.

brew install git
git --version # => git version 2.23.0

cURL

Install the latest version of cURL if it is not already installed.

brew install curl
curl --version # => curl 7.64.1 (...)

Docker

Install the latest version of Docker Desktop if it is not already installed. Since Docker Desktop is a UI application on Mac, use cask to install it.

Homebrew v2.x:

brew cask install --appdir="/Applications" docker

Homebrew v3.x:

brew install --cask --appdir="/Applications" docker

Docker Desktop must be launched to complete the installation so be sure to open the application after installing it:

open /Applications/Docker.app

Once installed, confirm the latest versions of both docker and docker-compose executables were installed.

docker --version # => Docker version 19.03.12, build 48a66213fe
docker-compose --version # => docker-compose version 1.27.2, build 18f557f9

Note: Some users have reported errors while running Fabric-Samples with the Docker Desktop gRPC FUSE for file sharing option checked. Please uncheck this option in your Docker Preferences to continue using osxfs for file sharing.

Go

Optional: Install the latest Fabric supported version of Go if it is not already installed (only required if you will be writing Go chaincode or SDK applications).

brew install go@1.21.8
go version # => go1.21.8 darwin/amd64

JQ

Optional: Install the latest version of jq if it is not already installed (only required for the tutorials related to channel configuration transactions).

brew install jq
jq --version # => jq-1.6

Linux (Ubuntu/Debian based distro)

Prerequisites: git, cURL, Docker

sudo apt-get install git curl docker-compose -y

# Make sure the Docker daemon is running.
sudo systemctl start docker

# Add your user to the Docker group.
sudo usermod -a -G docker <username>

# Check version numbers  
docker --version
docker-compose --version

# Optional: If you want the Docker daemon to start when the system starts, use the following:
sudo systemctl enable docker

Go

Optional: Install the latest version of Go (only required if you will be writing Go chaincode or SDK applications).

JQ

Optional: Install the latest version of jq (only required for the tutorials related to channel configuration transactions).