Install Sui
Sui is a scalable and performant layer-1 blockchain that is home to a complete stack of native primitives ideal for building decentralized applications. Such primitives, such as those for encryption, data storage, verification, and access control, provide developers with every piece of the application stack without needing to use layer-2 chains or off-chain solutions.
In contrast to other chains, Sui uses an object-centric model, where every item on the network is an object. Transactions use objects as input, which mutate an existing object or create new objects. Each object has a unique on-chain ID.
To create objects, submit transactions, and start building an application on Sui, first you must install Sui. This installation includes the Sui CLI, a tool that creates and manages address balances, builds and publishes smart contracts, and queries information from the network.
- Prerequisites
- Have a machine with one of the following supported operating systems:
- Linux: Ubuntu version 22.04 (Jammy Jellyfish) or newer
- macOS: macOS Monterey or newer
- Microsoft Windows: Windows 10 or 11
Quick install
The most effective way to install the Sui CLI is to use suiup
, 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. Other components will need to be installed through their individual binaries if you'd like to use them in the future.
- suiup
- 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.
You must have Homebrew installed before running the following command:
$ brew install sui
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.
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.
Confirm the installation
To confirm that Sui installed correctly:
- Open a terminal or console
- Type
sui --version
and press Enter
If you receive a "command not found" error, verify the Sui binaries directory is in your PATH
environment variable.
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 or clone another example to start building.
Installation details
Regardless of using suiup
, Homebrew, or Chocolately, your Sui installation will include the following packages:
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. |
suiup
installation details
suiup
copies the binaries to $HOME/.local/bi
n by default on macOS and Linux systems by default, unless the SUIUP_DEFAULT_BIN_DIR
environment variable has been set. macOS and Linux installations also include environment variables for XDG_DATA_HOME
, XDG_CACHE_HOME
, and XDG_CONFIG_HOME
.
On Windows, suiup
copies the binaries to LOCALAPPDATA\bin
, and will use LOCALAPPDATA
or USERPROFILE\AppData\Local
for storing data and TEMP
or USERPROFILE\AppData\Local\Temp
for caching.
Default configuration file
Regardless of whether you used suiup
, Homebrew, or Chocolately, Sui will store 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 will target.
-
Active address, which specifies the Sui address the CLI will use for transactions and queries.
-
Keystore location, which specifies where Sui stores your address' private keys.