Skip to main content

Installing GHC and Cabal

To compile Cardano Node using source code, you must install the Glasgow Haskell Compiler (GHC) and Cabal for building applications and libraries.

For each Cardano Node release, Input-Output recommends compiling binaries using specific versions of GHC and Cabal. For example, refer to the Releases page in the Cardano Node GitHub repository to determine the GHC and Cabal versions required for the current Cardano Node release. Table 1 lists GHC and Cabal version requirements for the current Cardano Node release.

Table 1 Current Cardano Node Versions

Release Date

Cardano Node Version

Cardano CLI Version

Cardano Tracer Version

GHC Version

Cabal Version

September 2026

11.1.3

11.2.3.0

0.5.0

9.6.7

3.12.1.0

To install GHC and Cabal:

  1. Using a terminal window on the computer designated to host your block-producing node, to install the latest versions of all previously installed packages assuming the answer yes to all prompts, type:
    sudo apt-get update -y
    sudo apt-get upgrade -y
  2. To install packages and tools required for downloading and compiling Cardano Node source code, type:
    sudo apt-get install autoconf automake build-essential curl g++ git jq libffi-dev libgmp-dev libncurses-dev libssl-dev libsystemd-dev libtool make pkg-config tmux wget zlib1g-dev liblmdb-dev libsnappy-dev protobuf-compiler liburing-dev -y

    Note
    Note

    To list all packages installed on your computer, type apt list --installed

  3. To use the GHCup installer to install GHC and Cabal, type:
    curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
  4. During the installation, when prompted:
    1. Press ENTER to proceed.
    2. To select the base channel, type G
    3. To decline the pre-releases channel, type N
    4. To decline the cross channel, type N
    5. To decline the 3rd-party channel, type N
    6. To prepend the required PATH variable to $HOME/.bashrc, type P
    7. When prompted to install haskell-language-server (HLS), type N
    8. When prompted to enable better integration with GHCup, type N
  5. When GHCup finishes installing GHC and Cabal, type the following commands to reload your shell profile, and then confirm that GHCup installed correctly:
    source $HOME/.bashrc
    ghcup --version

    Note
    Note

    If GHCup is installed correctly, then the ghcup --version command displays The GHCup Haskell installer, version <GHCupVersionNumber> where <GHCupVersionNumber> is the version number of GHCup installed on your computer.

  6. To set the Glasgow Haskell Compiler to the version required for compiling the current Cardano Node release, type the following commands where <GHCVersionNumber> is the GHC version that you need to install and use:
    ghcup install ghc <GHCVersionNumber>
    ghcup set ghc <GHCVersionNumber>
    ghc --version
  7. To set Cabal to the version required for compiling the current Cardano Node release, type the following commands where <CabalVersionNumber> is the Cabal version that you need to install and use:
    ghcup install cabal <CabalVersionNumber>
    ghcup set cabal <CabalVersionNumber>
    cabal --version
  8. On each computer hosting a relay or block-producing node in your stake pool configuration, repeat steps 1 to 7