Theme

Introduction

Installation

The quickest and easiest way to install Sugar is to download the pre-built binary by running an installation script, available for macOS, Linux and WSL (Windows Subsystem for Linux). For Windows system, see the 📌 below.

Run the following in your terminal:

bash <(curl -sSf https://sugar.metaplex.com/install.sh)

You will be asked which version you want to use. V1.x is for Candy Machine v2, V2.x is for Candy Machine v3. We recommend to use the latest version.

The script will install the binary to your machine and add it to your PATH. The modifications to your PATH variable may not take effect until the terminal is restarted. Follow the instructions of the installation script to see whether the terminal needs to be restarted or not.

Binaries

Binaries for the supported OS can be found at:

Other Installation Methods

When installing from crates.io or from source on Ubuntu or WSL (Windows Subsystem for Linux) you may need to install some additional dependencies:

sudo apt install libudev-dev pkg-config unzip

Crates.io

In order to install sugar from Crates.io, you will need to have Rust installed in your system. It is recommended to install Rust using rustup:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

After the installation completes, running:

rustc --version

should print the version of the Rust compiler. If the command fails, check if the ~/.cargo/bin directory is in your PATH environment variable.

The next step is to install Sugar from Crates.io:

cargo install sugar-cli

This will download the Sugar code from Crates.io and automatically install it for you.

Build From Source

In order to build Sugar from the source code, you will need to have Rust installed in your system. It is recommended to install Rust using rustup:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

After the installation completes, running:

rustc --version

should print the version of the Rust compiler. If the command fails, check if the ~/.cargo/bin directory is in your PATH environment variable.

The next step is to clone Sugar repository:

git clone https://github.com/metaplex-foundation/sugar.git

This will create a directory sugar with the latest code from the repository. Switch to the newly created directory:

cd sugar

Then, you can build and install the binary to ~/.cargo/bin:

cargo install --path ./

As long as ./cargo/bin is in your PATH environment variable, you will be able to execute sugar from any directory in your file system.

You need to execute cargo install from Sugar source code root directory — the directory where the Cargo.toml is located.

Previous
Overview