Skip to main content

Configure a Sui Client

The Sui client configuration specifies which network to connect to and which address to send transactions.

First, confirm that Sui has been installed successfully:

$ sui --version

If this command returns sui not found, then Sui is not installed and you must follow the installation instructions.

sui client

Run the Sui CLI with the command:

$ sui client
info

If a previous Sui installation stored a client.yaml file locally, you will receive the sui client --help output in the console. You can delete the existing ~/.sui/sui_config/client.yaml file if you'd like to start fresh, or you can continue using the existing configuration.

The prompt asks if you want to create the client.yaml file, select Y or press enter. You can skip the prompt with sui client -y.

No sui config found in `~/.sui/sui_config/client.yaml`, create one [Y/n]?

You will see the following output:

Generated new keypair ...
secret recovery phrase : [recovery phrase words are here]
Created "~/.sui/sui_config/client.yaml"
Set active environment to testnet
caution

Store recovery phrases securely and do not share them with anyone, as they provide access to any objects and tokens that an address owns.

It will not be visible again once the CLI history disappears.

Learn more about Sui addresses, key generation, and recovery phrases.

client.yaml

Your Sui client is now configured. By default, Sui stores this information in either the ~/.sui/sui_config/client.yaml file (macOS/Linux) or %USERPROFILE%\.sui\sui_config\client.yaml file (Windows). You can store a client.yaml file in a different location, if preferred, and specify its location with the --client.config flag.

The client.yaml contains the configuration for connecting to different Sui networks (Testnet, Mainnet, Devnet, and Localnet), as well as your current active environment, which tells the CLI which network to use when you don't explicitly specify one.

You can modify your configuration using the sui client subcommands. See the output of sui client --help for more information.

Sui stores the key for the Sui address in a separate file, ~/.sui/sui_config/sui.keystore (macOS/Linux) or %USERPROFILE/.sui/sui_config/sui.keystore (Windows). Learn more about Sui addresses in Create a Sui Address.

Next steps

Learn More About Sui Addresses

Now that you have created a Sui address, learn about address management, key pairs, and recovery phrase best practices.

Get SUI from Faucet

Obtain SUI from a faucet to deploy packages on Testnet.

Hello, World!

Clone the "Hello, World!" project.