# How To Compile AtomicDEX API from Source

The following tutorial introduces the reader to a simple method to build the AtomicDEX API 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

# 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-2020-10-25
# Command
rustup default nightly-2020-10-25
# Command (Optional, skip this step if it fails)
rustup component add rustfmt-preview

# Install the AtomicDEX API

# 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