---
description: >-
  Now the most complicated part (not so complicated if you follow this guide :)
  ) - is the installation process!
---

# Getting ready to install the Cardano Node (v8.1.1)

to successfully install (compile) the Carano node, we need to be sure that we have all the necessary ingredients! To get them (install) type the following commands:

```
sudo apt-get update -y
sudo apt-get upgrade -y
```

```
sudo apt-get install automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 libtool autoconf curl python3 htop  nload -y
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
```

This will install all the necessary software packages for our next steps.

As the Cardano node is using **cabal**, so let's install it as well. We will use the recommended version **3.6.2.0** and install it to our local bin folder (_.local/bin_)

to install cabal, we will be using **ghcup** (_ghcup_ is an installer for\
the general-purpose language [Haskell](https://www.haskell.org/)), for more info you can check: [https://www.haskell.org/ghcup/](https://www.haskell.org/ghcup/)&#x20;

```bash
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
```

This Haskell installation script will ask for input:

![Haskell Installation script](https://911769573-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7x9PFsptuN90DDOGB9%2F-MiLSYs4nB_wSe2prLT8%2F-MiLX2_a6EpvSxXNvyrr%2FCleanShot%202021-08-30%20at%2013.08.19.png?alt=media\&token=f4f4f181-64fb-4ceb-b086-a8fdb153513b)

Press **ENTER** to continue

* When asked _**"Do you want ghcup to automatically add the required PATH variable to "/home/cardano/.bashrc?"**_  **press "A"**
* When asked _**"Do you want to install haskell-language-server (HLS)?"**_ Answer "No" (**by pressing "N"**)
* When asked  _**"Do you want to install stack?"**_ Answer "No" (**by pressing "N"**)

![](https://911769573-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7x9PFsptuN90DDOGB9%2F-MiLSYs4nB_wSe2prLT8%2F-MiLYm1lDPskpaw7kcOm%2FCleanShot%202021-08-30%20at%2013.15.55.png?alt=media\&token=e4a0a28c-be50-430c-a84b-448500b224bf)

**Press ENTER** to proceed with the installation

When the installation is finished, you should see the following screen:

![](https://911769573-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7x9PFsptuN90DDOGB9%2F-MiLSYs4nB_wSe2prLT8%2F-MiLZW7rVAsrAbXriLq8%2FCleanShot%202021-08-30%20at%2013.18.58.png?alt=media\&token=9a121ce9-eacb-417c-a81f-e02c8daed119)

let's reload environment variables:&#x20;

```
source /home/cardano/.ghcup/env
```

Let's install the 3.8.1.0 version and set this one as the default:

```
ghcup install cabal 3.8.1.0
ghcup set cabal 3.8.1.0
cabal update
```

Let's check which version we have installed

```
 cabal --version 
 
```

you should see version 3.8.1.0

<figure><img src="https://911769573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKD4kqUsnAUoIGT5y1DkR%2Fuploads%2FNYh90YLZXjyZprLU2KxC%2FCleanShot%202023-06-25%20at%2009.18.24%402x.jpg?alt=media&#x26;token=1bfb6b56-9437-45ff-98e1-0e949bba2461" alt=""><figcaption></figcaption></figure>

&#x20;You should now have the cabal installed in _/home/cardano/.ghcup/bin_ folder.

### GHC 8.10.7 installation

Let's move to the next step - installing GHC - the Haskell code compiler (Cardano node is based on the Haskell programming language).&#x20;

As we already installed the handy ghcup tool, then this is done super easily:&#x20;

```
ghcup install ghc 8.10.7
```

![GHC installation](https://911769573-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7x9PFsptuN90DDOGB9%2F-MiLSYs4nB_wSe2prLT8%2F-MiLbBKeOU1FM3K3cBFc%2FCleanShot%202021-08-30%20at%2013.30.44.png?alt=media\&token=4527a69a-f751-4e85-865f-48171c206256)

After a short while, you should have GHC installed!\
Let's set it as the default version:

```
ghcup set ghc 8.10.7
```

And check if everything has gone as planned:

```
ghc --version
```

You should see:

![](https://911769573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKD4kqUsnAUoIGT5y1DkR%2Fuploads%2FGeLlViDtexX0AMIDzkWH%2FCleanShot%202022-06-27%20at%2014.40.26%402x.jpg?alt=media\&token=27b5a95c-ec79-44e9-a364-12b58cd76704)

### Install Libsodium

One more thing we need is the Libsodium libraries so let's do this! \
let's create a git folder where we will be compiling libsodium library from the source code:

```
mkdir -p ~/git && cd ~/git
```

Download and install libsodium library ( we need a specific branch of the library, so follow the guide)\


{% hint style="warning" %}
Starting from Cardano Node v8.0.0 needs a newer version of libsodium
{% endhint %}

```
git clone https://github.com/input-output-hk/libsodium
cd libsodium
git checkout dbb48cc
./autogen.sh
./configure
make
sudo make install

```

Let's add the following PATHs to our .bashrc file and load them.

```
echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.bashrc
echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" >> ~/.bashrc
source ~/.bashrc
```

additionally, we need the libsodium-dev package installed on our system

```
sudo apt install libsodium-dev
```

### **Installing Secp256k1**

```
mkdir -p ~/git && cd ~/git
git clone https://github.com/bitcoin-core/secp256k1
cd secp256k1
git checkout ac83be33
./autogen.sh
./configure --enable-module-schnorrsig --enable-experimental
make
sudo make install
```



Let's move to the next step - the actual installation of Cardano Node!
