Install Sui
Install the Sui CLI and verify it works. The CLI creates and manages address balances, builds and publishes smart contracts, and queries information from the network.
This page covers installation only. For other common tasks:
- Linux
- macOS
- Windows
- Ubuntu 22.04 (Jammy Jellyfish) or newer
- macOS Monterey or newer
- Windows 10 or 11
Quick install
You use the Sui CLI to interact with the Sui network, deploy packages, and manage assets. To install the Sui CLI, you can use suiup.
suiup is the most effective installation method, as it allows you to easily install and switch between different versions of not only the Sui CLI but also other Sui stack components like walrus and mvr.
Alternative quick install instructions for Homebrew or Chocolately do not support installing other Sui stack components. You need to install other components through their individual binaries if you'd like to use them in the future.
Installations using Homebrew or Chocolatey might take several minutes if you do not have any of the Sui prerequisites installed. Using suiup is often much faster and highly recommended.
- suiup (recommended)
- Homebrew
- Chocolatey
First, install suiup:
$ curl -sSfL \
https://raw.githubusercontent.com/Mystenlabs/suiup/main/install.sh \
| sh
Then, install Sui:
$ suiup install sui@testnet
For alternative installation methods, refer to the suiup repository.
Installing Sui with suiup does not configure the client. To use sui commands, you must configure the Sui client.
To confirm that Sui installed correctly:
- Open a terminal or console
- Type
sui --versionand press Enter
If you receive a "command not found" error, verify the Sui binaries directory is in your PATH environment variable.
suiup is the recommended installer. It supports version pinning and can install additional Sui stack components (walrus, mvr, move-analyzer). Use Homebrew only if you prefer to manage Sui through your system package manager.
You must have Homebrew installed before running the following command:
$ brew install sui
To confirm that Sui installed correctly:
- Open a terminal or console
- Type
sui --versionand press Enter
If you receive a "command not found" error, verify the Sui binaries directory is in your PATH environment variable.
suiup is the recommended installer. It supports version pinning and can install additional Sui stack components (walrus, mvr, move-analyzer). Use Chocolatey only if you prefer to manage Sui through your system package manager.
You must have Chocolately installed before running the following command:
$ choco install sui
Find more versions of Sui for Windows on the Chocolatey community website.
To confirm that Sui installed correctly:
- Open a terminal or console
- Type
sui --versionand press Enter
If you receive a "command not found" error, verify the Sui binaries directory is in your PATH environment variable.
The quick install is suitable for most use cases. For those wanting more control over the installation process, you can install from source or install binaries.
If Sui is already installed from a previous development environment, be sure to upgrade to the latest version.
Verify the installation
After installing, open a new terminal and run:
$ sui --version
If the installation succeeded, the command prints the installed Sui version.
Before you can create and publish a smart contract, you must configure a Sui client and obtain SUI tokens.
Then, you can create a "Hello, World!" example.
Installation details
suiup installation details
Refer to the suiup repository's README for information regarding installation files and their locations.
Default configuration file
Regardless of whether you used suiup, Homebrew, or Chocolately, Sui stores a primary configuration in the ~/.sui/sui_config/client.yaml file. This file defines settings and preferences for your environment, such as:
-
Network environment details for Mainnet, Testnet, Devnet, and Localnet networks.
-
Active environment, which specifies the network the CLI commands target.
-
Active address, which specifies the Sui address the CLI uses for transactions and queries.
-
Keystore location, which specifies where Sui stores your address' private keys.
Troubleshooting
sui: command not found after installation
Open a new terminal window after installing. If the issue persists, verify that the shell can find the sui binary:
$ command -v sui
If no path is printed, the install directory is not in your PATH. The default suiup install location is ~/.local/bin (see suiup README). Add export PATH="$HOME/.local/bin:$PATH" to your shell profile (~/.bashrc, ~/.zshrc, or ~/.bash_profile), then restart your terminal.
Client/server API version mismatch
Your local Sui CLI version does not match the network you are targeting. Switch to the correct version with suiup:
$ suiup install sui@testnet
Replace testnet with mainnet or devnet as needed.
Homebrew or Chocolatey installation is slow
Homebrew and Chocolatey might compile dependencies from source if the package manager has not cached prebuilt binaries. This can take several minutes. For a faster installation, use suiup instead:
$ curl -sSfL https://raw.githubusercontent.com/MystenLabs/suiup/main/install.sh | sh
$ suiup install sui@testnet
Permission denied during installation
Do not use sudo to install Sui. The suiup installer writes to your home directory and does not require elevated privileges. If a previous installation used sudo, remove it first:
$ sudo rm -f /usr/local/bin/sui
Then reinstall with suiup.
Multiple Sui versions installed
If you previously installed Sui through Homebrew, Cargo, or a manual binary and also have suiup, you might have conflicting versions. Check which binary is active:
$ which sui
$ sui --version
Remove the older installation method and use suiup exclusively to manage versions. Run suiup install sui@<network> to switch between network-compatible versions.