Skip to content
ICP CLI
Feedback welcome! Report issues on GitHub, ask questions on the Forum, or chat with us on Discord.

Installation

Set up everything you need to build and deploy canisters on the Internet Computer.

What you’ll install:

ToolPurpose
icp-cliCore CLI for building and deploying canisters
ic-wasmOptimizes WebAssembly for the Internet Computer
Language toolchainMotoko compiler (via mops) or Rust compiler

Windows users: Local networks require Docker Desktop, and Motoko requires WSL. For the full experience, install both and run commands inside WSL. Rust-only projects deploying to mainnet can run natively on Windows.

Linux users: The pre-compiled binary requires system libraries that may be missing on minimal installs. If installation fails or icp won’t start, install these dependencies:

Terminal window
# Ubuntu/Debian
sudo apt-get install -y libdbus-1-3 libssl3 ca-certificates
# Fedora/RHEL
sudo dnf install -y dbus-libs openssl ca-certificates

Required: Node.js (LTS) — needed for npm and for building frontend canisters.

1. Install the core tools:

Terminal window
npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm

2. Install your language toolchain:

Motoko:

Terminal window
npm install -g ic-mops

Rust (if not already installed):

Terminal window
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown

3. Verify installation:

Terminal window
icp --version
ic-wasm --version

Alternative Installation Methods

If you prefer not to use npm, or need platform-specific options, see the sections below.

icp-cli

Homebrew (macOS/Linux):

Terminal window
brew install icp-cli

Shell Script (macOS/Linux/WSL):

Terminal window
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/dfinity/icp-cli/releases/latest/download/icp-cli-installer.sh | sh

Shell Script (Windows):

Terminal window
powershell -ExecutionPolicy Bypass -c "irm https://github.com/dfinity/icp-cli/releases/latest/download/icp-cli-installer.ps1 | iex"

ic-wasm

ic-wasm is a WebAssembly post-processing tool that optimizes canisters for the Internet Computer. It provides:

  • Optimization: ~10% cycle reduction for Motoko, ~4% for Rust
  • Size reduction: ~16% smaller binaries for both languages
  • Metadata: Embed Candid interfaces and version information
  • Shrinking: Remove unused code and debug symbols

When is it needed?

  • Required if using official templates (motoko, rust, hello-world) — all backend templates use recipes that depend on ic-wasm
  • Required if using official recipes (@dfinity/motoko, @dfinity/rust) — these recipes inject required metadata using ic-wasm
  • Not required if building canisters with custom script steps that don’t invoke ic-wasm

Installation:

Homebrew (macOS/Linux):

Terminal window
brew install ic-wasm

Shell Script (macOS/Linux):

Terminal window
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/dfinity/ic-wasm/releases/latest/download/ic-wasm-installer.sh | sh

Shell Script (Windows):

Terminal window
powershell -ExecutionPolicy Bypass -c "irm https://github.com/dfinity/ic-wasm/releases/latest/download/ic-wasm-installer.ps1 | iex"

Learn more: ic-wasm repository

Language Toolchains

Motoko:

Terminal window
curl -fsSL cli.mops.one/install.sh | sh

Note: Requires Node.js and a package manager (npm, pnpm, or bun). The shell script installs the latest Mops version stored onchain on ICP.

Rust:

Install from rustup.rs:

Terminal window
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown

Troubleshooting

“command not found: icp” (after curl install)

The binary isn’t in your PATH. Add this to your shell config (~/.bashrc, ~/.zshrc, etc.):

Terminal window
export PATH="$HOME/.cargo/bin:$PATH"

Then restart your shell or run source ~/.bashrc (or ~/.zshrc).

“Cannot connect to Docker” (Windows)

On Windows, Docker Desktop must be running before starting a local network. Ensure:

Network launcher download fails

The network launcher downloads automatically on first use. If it fails:

  • Check your internet connection
  • Try again (transient failures are possible)
  • Download manually from icp-cli-network-launcher releases and set ICP_CLI_NETWORK_LAUNCHER_PATH

Next Steps

Browse all documentation →