Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mystenlabs/sui/llms.txt
Use this file to discover all available pages before exploring further.
This guide covers installation methods for the Sui CLI.
Prerequisites
- Rust: Version 1.75.0 or later
- Git: For cloning the repository
- System dependencies: Build tools for your platform
macOS
Linux (Ubuntu/Debian)
Linux (Fedora/RHEL)
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install dependencies
brew install curl cmake git
sudo apt-get update
sudo apt-get install -y curl git cmake build-essential libssl-dev pkg-config
sudo dnf install -y curl git cmake gcc gcc-c++ openssl-devel
Install Rust
If you don’t have Rust installed:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
Verify installation:
rustc --version
cargo --version
Installation Methods
Method 1: Install from Crates.io (Recommended)
Install the latest stable release from crates.io:
cargo install --locked sui
This installs the sui binary to ~/.cargo/bin/.
Method 2: Build from Source
For the latest development version:
# Clone the repository
git clone https://github.com/MystenLabs/sui.git
cd sui
# Checkout the latest release tag (optional)
git checkout <version-tag>
# Build and install
cargo install --locked --path crates/sui
Method 3: Install Specific Version
To install a specific version:
cargo install --locked sui --version <version>
Verify Installation
Check that the CLI is installed correctly:
You should see output like:
First-Time Setup
After installation, initialize the Sui client:
This creates the default configuration directory at ~/.sui/sui_config/ and prompts you to:
- Select a network environment (mainnet, testnet, devnet, or local)
- Generate a new keypair
Manual Configuration
To set up without prompts:
# Accept defaults
sui client --yes
# Or specify environment and config path
sui client --client.env testnet --client.config /path/to/config
Network Environments
Add network environments:
# Add mainnet
sui client new-env --alias mainnet --rpc https://fullnode.mainnet.sui.io:443
# Add testnet
sui client new-env --alias testnet --rpc https://fullnode.testnet.sui.io:443
# Add devnet
sui client new-env --alias devnet --rpc https://fullnode.devnet.sui.io:443
# Add local network
sui client new-env --alias local --rpc http://127.0.0.1:9000
# Switch to an environment
sui client switch --env testnet
Update the CLI
From Crates.io
cargo install --locked --force sui
From Source
cd sui
git pull
git checkout <new-version-tag>
cargo install --locked --force --path crates/sui
Uninstall
To remove the Sui CLI:
To remove configuration and data:
Troubleshooting
Command Not Found
If sui command is not found, ensure ~/.cargo/bin is in your PATH:
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
For zsh:
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Build Failures
-
Ensure Rust is up to date:
-
Clean build artifacts:
-
Retry installation with verbose output:
cargo install --locked sui --verbose
OpenSSL Errors (Linux)
If you encounter OpenSSL-related errors:
# Ubuntu/Debian
sudo apt-get install libssl-dev pkg-config
# Fedora/RHEL
sudo dnf install openssl-devel
Next Steps