Install from Source
You can install Sui from source, either locally or directly from GitHub.
These instructions are for special use cases. The recommended way to install and manage Sui is suiup. Use it unless you have a specific reason to install from source or binaries.
At minimum, you need Rust and Cargo installed for the Sui framework. Cargo comes bundled with Rust, so installing Rust also installs Cargo:
-
Download and install Rust and Cargo:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shIf you have Rust installed, update to the latest version:
$ rustup update stableDepending on your operating system, you might require additional prerequisites. Expand Additional prerequisites to check the requirements for your operating system.
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 cmakeVerify installation with
$ cmake --version -
Download and install libpq:
$ brew install libpqVerify 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 | shIf 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 curlVerify installation with
$ curl --version -
Download and install Git CLI:
$ sudo apt-get install git-allVerify installation with
$ git --version -
Download and install CMake:
$ sudo apt-get install cmakeVerify installation with
$ cmake --version -
Download and install GCC:
$ sudo apt-get install gccVerify installation with
$ gcc --version -
Download and install libssl-dev:
$ sudo apt-get install libssl-devIf 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-devIf 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-indexerand--with-graphqloptions withsui start, download and install libpq-dev:$ sudo apt-get install libpq-devSee 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
-
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 and install the LLVM Compiler Infrastructure. Look for a file with a name similar to
LLVM-15.0.7-win64.exefor 64-bit Windows, orLLVM-15.0.7-win32.exefor 32-bit Windows. -
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 -
Download Protocol Buffers (
protoc-xx.x-win32.ziporprotoc-xx.x-win64.zip) and add the\bindirectory to your WindowsPATHenvironment variable. -
For Windows on ARM64 only: Download and install Visual Studio 2022 Preview.
You can install from source either directly from GitHub or from your local drive. Regardless of which install from source method you use, the installer places the Sui components 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 --features tracing flag enables the tracing feature described in the following note.
The tracing feature enables trace-based debugging, profiling, and Move test coverage support in the Sui CLI. It adds minimal runtime overhead unless you are actively using those features.
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-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 installcommand from the repo root.$ cargo install --locked --path crates/sui --features tracingThe
--features tracingflag enables the tracing feature described in the following note.
The tracing feature enables trace-based debugging, profiling, and Move test coverage support in the Sui CLI. It adds minimal runtime overhead unless you are actively using those features.
How do I verify the installation?
After installing, open a new terminal and run:
$ sui --version
If the installation succeeded, the command prints the installed Sui version.