# Prerequisite Installation

### Install Git

Download the latest version of [git](https://git-scm.com/downloads) if it is not already installed.

```bash
sudo apt-get update
```

```bash
sudo apt-get install git
```

### Install cURL

Download the latest version of the [cURL](https://curl.haxx.se/download.html) tool if it is not already installed or if you get errors running the curl commands from the documentation.

```bash
sudo apt install curl
```

### Docker and Docker Compose

You will need the following installed on the platform on which you will be operating, or developing (or for), Hyperledger Fabric:

**Set up the repository**

1. Update the `apt` package index and install packages to allow `apt` to use a repository over HTTPS:

```bash
sudo apt-get update

sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
```

2. Add Docker’s official GPG key:

```bash
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
```

3. Use the following command to set up the repository:

```bash
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```

**Install Docker Engine**

1. Update the `apt` package index:

```bash
sudo apt-get update
```

2. Install Docker Engine, containerd, and Docker Compose.

&#x20;      To install the latest version, run:

```bash
 sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

3. Make sure the docker daemon is running.

```bash
sudo systemctl start docker
sudo systemctl enable docker
sudo groupadd docker
sudo usermod -aG docker ${USER}
```

```bash
sudo setfacl --modify user:$USER:rw /var/run/docker.sock
```

4. Check if your Hello-World works fine:&#x20;

<pre class="language-bash"><code class="lang-bash"><strong>sudo docker run hello-world
</strong></code></pre>

5. Install docker-compose and check its version

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

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

docker-compose --version

```

### Install GoLang

We would need Go-Lang to run chaincodes on Hyperledger Fabric. Let's Install by running the below commands.

```bash
sudo snap install go --classic
source ~/.profile
```

Let's check the go version.

```bash
go version
```

### Install NVM

NVM is a Node Version Manager tool. Using the NVM utility, you can install multiple node.js versions on a single system. You can also choose a specific Node version for applications.

```bash
sudo apt-get install build-essential libssl-dev
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
```

### Install Node and NPM

You can install multiple node.js versions using nvm. And use the required version for your application from installed node.js.

```bash
nvm install 20
nvm use 20
```

Let's check Node & Npm Versions

```bash
node --version
npm --version
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://abc.bharatblockchain.io/hyperledger-fabric/prerequisite-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
