Install from Source
These instructions are for special use cases. For most users, Quick Install shows the best way to install Sui.
You can install Sui from source, either locally or directly from GitHub. At minimum, you will need Rust and Cargo installed for the Sui framework:
-
Download and install Rust:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
If you have Rust installed, update to the latest version:
$ rustup update stable
-
Download and install Cargo:
$ curl https://sh.rustup.rs -sSf | sh
Depending on your operating system, you may require additional prerequisites.
Additional prerequisites
- macOS
- Linux
- Windows
Most modern MacOS systems have Homebrew and cURL preinstalled.
-
Download and install Homebrew:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Download and install CMake:
$ brew install cmake
Verify installation with
$ cmake --version
-
Download and install libpq:
$ brew install libpq
Verify installation with
$ libpq --version
-
Download and install PostgreSQL.
These prerequisites use the apt
package manager for Linux. Adjust the commands accordingly per your package manager.
You can install all of the prerequisites for Linux at once using the following command:
$ sudo apt-get install curl git-all cmake gcc libssl-dev pkg-config libclang-dev libpq-dev build-essential
-
Download and install Rust:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
If you have Rust installed, update to the latest version:
$ rustup update stable
-
Download and install Cargo
$ curl https://sh.rustup.rs -sSf | sh
-
Download and install cURL:
$ sudo apt-get install curl
Verify installation with
curl --version
-
Download and install Git CLI:
$ sudo apt-get install git-all
Verify installation with
$ git --version
-
Download and install CMake:
$ sudo apt-get install cmake
Verify installation with
$ cmake --version
-
Download and install GCC:
$ sudo apt-get install gcc
Verify installation with
$ gcc --version
-
Download and install libssl-dev:
$ sudo apt-get install libssl-dev
If the version of Linux you use doesn't support libssl-dev, find an equivalent package for it on the ROS Index.
If you have OpenSSL you might also need to also install pkg-config:
$ sudo apt-get install pkg-config
-
Download and install libclang-dev:
$ sudo apt-get install libclang-dev
If the version of Linux you use doesn't support libclang-dev, find an equivalent package for it on the ROS Index.
-
If you plan to use the
--with-indexer
and--with-graphql
options withsui start
, download and install libpq-dev:$ sudo apt-get install libpq-dev
See Local Network for more information.
If the version of Linux you use doesn't support libpq-dev, find an equivalent package for it on the ROS Index.
-
Download and install build-essential:
$ sudo apt-get install build-essential
-
Download and install C++ build tools before downloading Rust.
-
Download and install Rust.
If you use Windows 11, see information about using the Rust installer on the Rust website. The installer checks for C++ build tools and prompts you to install them if necessary. Select the option that best defines your environment and follow the instructions in the install wizard.
If you have Rust installed, update to the latest version:
$ rustup update stable
-
Download and install Cargo: Download and install
rustup-init.exe
-
Windows 11 ships with a Microsoft version of cURL already installed; however, if you are using Windows 10 or want to use the cURL project version instead, download and install it from https://curl.se/windows/.
-
Download and install the Git command line interface.
-
Download and install CMake.
-
Download Protocol Buffers (
protoc-xx.x-win32.zip
orprotoc-xx.x-win64.zip
) and add the\bin
directory to your WindowsPATH
environment variable. -
For Windows on ARM64 only: Download and install Visual Studio 2022 Preview.
-
Download and install the LLVM Compiler Infrastructure. Look for a file with a name similar to
LLVM-15.0.7-win64.exe
for 64-bit Windows, orLLVM-15.0.7-win32.exe
for 32-bit Windows.
You can install from source either directly from GitHub or from your local drive. Regardless of which install from source method you use, the Sui components are found in the ~/.cargo/bin
folder.
You can also download the source code to locally access files.
- GitHub source
- Local source
Use Cargo to install Sui directly from the GitHub repo:
$ cargo install --locked --git https://github.com/MystenLabs/sui.git --branch testnet sui --features tracing
The tracing feature enables Move test coverage and debugger support in the Sui CLI. These features are not available unless you enable tracing.
Replace the testnet
branch in the previous command if necessary. Available options are:
main
: Latest updates. Least stable.devnet
: Includes experimental features.testnet
: Includes beta features.mainnet
: Stable release.
You can build and install additional packages as needed. Replace sui
in the previous command with the package name in the following table.
Name | Description |
---|---|
move-analyzer | Language Server Protocol implementation. |
sui | Main Sui binary. |
sui-bridge | Sui native bridge. |
sui-data-ingestion | Capture full node data for indexer to store in a database. |
sui-faucet | Local faucet to mint coins on local network. |
sui-graphql-rpc | GraphQL service for Sui RPC. |
sui-node | Run a local node. |
sui-test-validator | Run test validators on a local network for development. |
sui-tool | Provides utilities for Sui. |
You can clone the public Sui repo and install from source on your local machine.
-
Fork the Sui repo.
-
Use a console to clone the fork to the desired directory.
$ git clone https://github.com/YourOrg/sui.git
-
Navigate to the repo directory and switch to the branch you want to build against.
main
: Latest updates. Least stable.devnet
: Includes experimental features.testnet
: Includes beta features.mainnet
: Stable release.
$ git switch testnet
-
Run the
cargo install
command from the repo root.$ cargo install --locked --path crates/sui --features tracing
The tracing feature enables Move test coverage and debugger support in the Sui CLI. These features are not available unless you enable tracing.
Related links
Install the Sui framework and its required prerequisites on your system.
Each Sui release provides a set of binaries for several operating systems. You can download these binaries from GitHub and use them to install Sui.