Skip to main content

Installing tools

Beginner
Getting started
Tutorial

Overview

When developing on ICP, there are two primary tools used: dfx, a CLI tool used to create, deploy, and manage canisters, and a canister development kit (CDK) which provides an environment for writing canister code in different programming languages while supporting ICP features.

Currently supported CDKs include:

Gitpod and GitHub Codespaces

If you use GitHub Codespaces or Gitpod to deploy your project, installing these dependencies is not necessary.

Links to available Codespaces and Gitpod examples can be found in the hello world example.

Installing dfx via dfxvm

dfx is part of the IC SDK.

dfx is natively supported on Linux or macOS 12.* Monterey or later.

There is no native support for dfx on Windows. However, by installing the Windows Subsystem for Linux (WSL 2), you can run dfx on a Windows system as described below.

Not all features of dfx may be supported on WSL 2.

To install the IC SDK, install dfxvm. dfxvm is a command-line tool used for installing and switching between different versions of dfx.

It enables developers to pivot between different projects that are built with different dfx versions. Read more about dfxvm.

You can download and install the latest version of dfxvm by running the command below:

sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"

If you are using a machine running Apple silicon, you will need to have Rosetta installed. You can install Rosetta by running softwareupdate --install-rosetta in your terminal.

Installing a CDK

Motoko

By default, Motoko is installed with dfx. Alternatively, you can build it from source following these instructions.

Rust

By default, the Rust CDK is installed with dfx. Alternatively, you can install it yourself by adding the following dependency in your Cargo.toml file:

[lib]
crate-type = ["cdylib"]

[dependencies]
ic-cdk = "0.12"
# Only necessary if you want to define Candid data types
candid = "0.10"

Below is a brief example on how to use the Rust CDK:

#[ic_cdk::query]
fn hello() -> String {
"world".to_string()
}

TypeScript / JavaScript

By default, the TypeScript and JavaScript CDK, known as Azle, is installed with dfx. To install it manually, you can follow these steps.

Azle is currently in beta and should be used with caution.

Python

The Python CDK, known as Kybra, is installed with dfx. To install it manually, you can follow these steps.

Kybra is currently in beta and should be used with caution.

Solidity

Solidity smart contracts can be created using the Bitfinity EVM. To use the Bitfinity EVM, you can make calls to the Bitfinity mainnet or testnet.

Learn more about how to use the Bitfinity EVM

Bitfinity EVM is currently in beta and should be used with caution.

C++

C++ is supported through the ICPP-pro CDK. To install it, follow the instructions here

Next steps