# How To Compile Komodo DeFi Framework from Source

The following tutorial introduces the reader to a simple method to build the Komodo DeFi Framework from source.

# Installing Dependencies

# Step 1: OS Packages

# Command
sudo apt update
sudo apt-get install build-essential git jq llvm-3.9-dev libclang-3.9-dev clang-3.9 cmake libssl-dev pkg-config

If you are using Ubuntu 20.04, run:

sudo apt update
sudo apt-get install build-essential git jq llvm-dev libclang-dev clang cmake libssl-dev pkg-config

For rpm-based distributions:

sudo dnf groupinstall "Development Tools"
sudo dnf install jq clang cmake openssl-devel clang-devel libzstd systemd-devel  # systemd-devel is used for libudev dep instead of pkg-config

# Step 2: Install Rust

# Command
curl https://sh.rustup.rs -sSf | sh

When asked to select an installation type, select the following.

2) Customize installation

Choose default host triple and toolchain, then select minimal profile.

Once the installation is complete, enter Logout and then Login again.

Alternatively, you may execute the following command in each active shell until you reach the Login again.

source $HOME/.cargo/env

# Step 3: Install Rust components

# Command
rustup install nightly-2022-02-01
# Command
rustup default nightly-2022-02-01
# Command (Optional, skip this step if it fails)
rustup component add rustfmt-preview

# Install the Komodo DeFi Framework

# Step 1: Download source code

cd ~ ; git clone https://github.com/KomodoPlatform/atomicDEX-API --branch mm2.1 --single-branch && cd atomicDEX-API

# Step 2: Compile Source Code

# Command
cargo build --features native -vv