Sui Development Setup Guide

Sui CLI Setup

Before we can install Sui to our local machine, we first need to ensure that certain prerequisites have been installed on our machine. Sui supports the following operating systems:

Disclaimer: Installing SUI process is a long process which can take up to 2 hours depending on your internet speed and reliability. Please be patient and follow the instructions carefully. Also ensure you have at least 6GB of storage free on your machine.

If you find the process is too much you can go ahead and set it up on a virtual environment like Github Codespaces or Gitpod. This will just act as a bandaid solution as you will require to reinstall the sui binaries on every instance which is not sustainable long term. However it is a viable option if you struggle too much installing sui cli locally, especially if you are on a low-end machine, on windows or just have no space to spare.

Jump to the step based on the OS that your machine is running.

Click below to go directly to the setup guide for your operating system:

After you're done downloading the required prerequisites for your OS, continue to Step 5, where we'll download the Sui binaries (i.e. actually installing Sui on our machine).


Linux Setup

The Linux OS requires the following prerequisites:

1. cURL

First, open up a terminal. We'll be using cURL to install most of the prerequisites. To check if you have cURL installed, run the command curl in your terminal. If you have cURL installed, the system will print curl: try 'curl --help' or 'curl --manual' for more information. Otherwise, you will see something like curl command not found. If you don't have cURL installed on your device, run the command below to install it:

sudo apt install curl

2. Rust and Cargo

Sui requires Rust and Cargo (Rust's package manager). The suggested method to install Rust is with rustup using cURL. Run the following command in your terminal to install Rust and Cargo. If the terminal prompts with you installation options, choose the default option.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

After installing Rust, you might need to close and reopen your terminal. Sui uses the latest version of Cargo to build and manage dependencies. Use the following command to update Rust with rustup:

rustup update

3. Updating apt-get

We use the APT package manager, so let's go ahead and make sure it's updated:

sudo apt-get update

4. Git

Run the following command to install Git, including the Git CLI:

sudo apt-get install git-all

5. CMake

Use the following command to install CMake:

sudo apt-get install cmake

6. gcc

Use the following command to install the GNU Compiler Collection, gcc:

sudo apt-get install gcc

7. libssl-dev

Use the following command to install libssl-dev. If the version of Linux you use doesn't support libssl-dev, find an equivalent package for it on the ROS Index.

sudo apt-get install libssl-dev

Also, if you have OpenSSL you might need to also install pkg-config:

sudo apt-get install pkg-config

8. libclang-dev

Use the following command to install libclang-dev. If the version of Linux you use doesn't support libclang-dev, find an equivalent package for it on the ROS Index

sudo apt-get install libclang-dev

9. build-essential

Use the following command to install build-essential:

sudo apt-get install build-essential

Proceed to Installing Sui Binaries


macOS Setup

The macOS requires the following prerequisites:

1. Brew

Open up a terminal. macOS includes a version of cURL you can use to install Brew. We'll be using Brew to install other tools, including a newer version of cURL. Use the following command to install Brew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. Rust and Cargo

Run the following command in your terminal to install Rust and Cargo. If the terminal prompts with you installation options, choose the default option.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

After installing Rust, you might need to close and reopen your terminal. Sui uses the latest version of Cargo to build and manage dependencies. Use the following command to update Rust with rustup:

rustup update stable

3. cURL

brew install curl

4. CMake

Use the following command to install CMake:

brew install cmake

5. Git CLI

Use the following command to install Git:

brew install git

Proceed to Installing Sui Binaries


Windows Setup

On windows the process for installing Sui cli is quite tricky and there are various approaches to doing it. Some will require you to install the following prerequisites some will not. There are 3 methods for installing Sui CLI according to your preference and also expertise:

NOTE: We recommend using the WSL (Windows Subsystem for Linux) method because it provides the most complete, developer-friendly environment for building, testing, and deploying Sui smart contracts. It closely mirrors the official Sui documentation, supports all necessary development tools, and gives you full control to use advanced commands like sui move test, run local validators, and work with open-source code — making it ideal for long-term learning and serious development.

However if you face challenges using that method you can use the Chocolatey method or the Manual method

Installation Methods Breakdown

Method Best For Pros Cons
WSL (Windows Subsystem for Linux) Developers building & testing smart contracts ✅ Matches Sui docs
✅ Full testing support
✅ Linux tools & flexibility
❌ Takes more time
❌ Requires Ubuntu setup
Chocolatey Beginners who just want to try the CLI quickly ✅ Fast install
✅ Easy updates
✅ No coding knowledge needed
❌ Not dev-friendly
❌ Less control
Manual Download Power users who want a quick setup without package managers ✅ Simple
✅ No build process
✅ Works offline after setup
❌ No auto-updates
❌ No testing tools
❌ Easy to misconfigure

Prerequisites Breakdown by Installation Method

Tool WSL (Recommended) Chocolatey Manual Download
Rust & Cargo ✅ Required ❌ Not needed ❌ Not needed
Git CLI ✅ Required ❌ Not needed ❌ Not needed
CMake ✅ Required ❌ Not needed ❌ Not needed
C++ Build Tools ✅ Required (build-essential) ❌ Not needed ❌ Not needed
cURL ✅ Required ✅ Used to install tools âš ī¸ Optional
Note: The WSL method builds Sui from source, so it needs all development tools. Chocolatey and Manual Download methods use prebuilt binaries — so Rust, Git, and compilers are not required.

If you decide to use the WSL method you can go ahead and proceed installing the following prerequisites:

1. Rust and Cargo

The first thing we'll be installing is Rust. To do so, check out the 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.

Sui uses the latest version of Cargo to build and manage dependencies. Use the following command to update Rust with rustup a tool you should have installed as part of the Rust installer.

rustup update stable

2. cURL

Windows 11 ships with a Microsoft version of cURL already installed. If you are on windows 10 or want to use the curl project version instead, download and install it from the cURL website.

3. CMake

Download and install CMake from the CMake website.


Chocolatey Method

Chocolatey is a package manager for Windows that makes it easy to install and update software. It's a great option for beginners who want a quick and easy way to install Sui.

To install Chocolatey on Windows, you run powershell as an administrator and use the following command:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

After installing Chocolatey, you can use the following command to install Sui:

choco install sui

After that to check whether sui is installed correctly, open a new terminal and run the following command:

sui --version

If you did it correctly you should see a similar output displaying the version of Sui you installed.


Virtual Environments Setup

Here we will explain just how to setup the virtual instances. We will explain on how to setup Github codespaces but the process is virtually the same even for gitpod. After that you can just refer to Linux setup to install the prerequisites and Installing Sui Binaries to install the binaries since these virtual instances run on linux so it will just be like working with a linux machine.

GitHub Codespaces

To get started with GitHub Codespaces, you need to have a GitHub account. If you don't have one, you can create one for free.

Step 1: Create a New GitHub Repository

  1. Go to github.com and log in.
  2. Click the "+" icon (top-right corner) → "New repository".
  3. Fill in:
    • Repository name (e.g., sui-bootcamp)
    • Description (optional)
    • Choose Public or Private
  4. Check: ✅ Add a README file - this is very important since for us to initialize a codespace on this repository we will need it to have a file inside
  5. Click "Create repository"

Step 2: Open the Repository in a Codespace

  1. On your repository page, click the green "<> Code" button.
  2. Click the Codespaces tab.
  3. Click "Create codespace on main" (or whatever branch you're using).

GitHub will now set up your development environment — including VS Code in the browser.

Step 3: Explore Your Codespace

Once it loads:

Step 4: Install Project Dependencies

Now this will be like you have a linux computer so you can just head to the Linux setup and follow the instructions there to install the prerequisites and then proceed to the Installing the Binaries section to install the binaries.

Step 5: Run and Test Your Code

You can write Move smart contracts, Rust code, or frontend apps directly in your Codespace. Use the terminal to run commands like:

sui move test
cargo build
npm install

Installing Sui Binaries

At this point, you should have installed the prerequisites required depending on the OS that your device uses. We're ready to proceed with installing Sui on our device!

Run the following command in your terminal to install Sui binaries from the devnet branch:

cargo install --locked --git https://github.com/MystenLabs/sui.git --branch devnet sui --features tracing

The tracing feature is important as it adds Move test coverage and debugger support in the Sui CLI. Unless it is enabled you will not be able to use these two features.

NOTE: If you used the manual method or the Chocolatey method on Windows, you can skip this step, for you everything is already installed.

Setting Up the Sui Wallet

The Sui Wallet is your gateway to interacting with the Sui blockchain. You'll use it to store SUI tokens, mint NFTs, and connect to dApps you build during this bootcamp.


Step 1: Install the Sui Wallet Extension

  1. Open your browser (Chrome or Brave recommended).
  2. Visit the official Sui Wallet (Slush - A Sui wallet) extension page: 👉 Chrome Web Store
  3. Click "Add to Chrome" or "Install Extension".
  4. Once installed, the wallet icon will appear in your browser toolbar.

🛠 Step 2: Create a New Wallet

  1. Click the Sui Wallet icon in your browser.
  2. Click "Create New Wallet".
  3. Set a strong password (you'll need this every time you open the wallet).
  4. Save your Recovery Phrase (Seed Phrase) somewhere safe — don't share it!
🚨 Warning: If you lose your recovery phrase, you won't be able to recover your wallet.

Step 3: Switch Networks

  1. Open your Sui Wallet.
  2. In the bottom-left corner, click the user profile icon and click on "Network".
  3. Select "Testnet" or your desired network.
  4. Your wallet is now ready to interact with testnet apps.

Step 4: Get Free Test SUI Tokens

  1. In the wallet, click "Request SUI Tokens from Faucet".
  2. A transaction will be submitted to the testnet faucet.
  3. Wait a few seconds — you should see some SUI tokens appear in your balance.

You can now:


Tips


💧 How to Request SUI Testnet & Devnet Tokens

If you're developing on the Sui blockchain, you'll need test tokens to deploy and interact with smart contracts. There are multiple ways to get test tokens on Sui:


✅ 1. Request via Sui Web Faucet

The Sui Foundation provides an official web faucet for both Testnet and Devnet. To switch you just switch to your preferred network using the dropdown menu in the top right corner of the page.

Links:

📝 Steps:

  1. Open the appropriate faucet URL.
  2. Paste your Sui wallet address.
  3. Click "Request" to receive tokens.
  4. Tokens will be sent to your wallet in a few seconds.

2. Request via Discord Bot

Sui's Discord server offers a faucet bot for Testnet & Devnet tokens.

📝 Steps:

  1. Join the official Sui Discord here
  2. Go to the #testnet-faucet or #devnet-faucet channel.
  3. Use the command:
!faucet <your-address>

For example to request from this wallet, 0xd8133d487f2bd59baf4906ba1b76e29504dd8ab7900a2b1ff4d489eab88d59b1 this is how the command would look like:

!faucet 0xd8133d487f2bd59baf4906ba1b76e29504dd8ab7900a2b1ff4d489eab88d59b1
  1. Tokens will be sent to your wallet in a few seconds.

3. Request via cURL

Use the following cURL command to request tokens directly from the faucet server. In this case we'll be requesting devnet tokens.

curl --location --request POST 'https://faucet.devnet.sui.io/v2/gas' \
--header 'Content-Type: application/json' \
--data-raw '{
    "FixedAmountRequest": {
        "recipient": "<YOUR SUI ADDRESS>"
    }
}'

For testnet you just proceed to replace devnet with testnet in the url to look like this:

curl --location --request POST 'https://faucet.testnet.sui.io/v2/gas' \
--header 'Content-Type: application/json' \
--data-raw '{
    "FixedAmountRequest": {
        "recipient": "<YOUR SUI ADDRESS>"
    }
}'

The output should display transaction details confirming your tokens have been sent.



Frontend Development Setup

Now that you have Sui CLI and your wallet set up, let's configure your frontend development environment. This section will guide you through setting up React-based projects with TypeScript and Tailwind CSS for building Sui dApps.

Prerequisites: Make sure you have Node.js (version 16 or higher) and npm/yarn installed on your system. You can verify by running node --version and npm --version.

React + Vite + TypeScript + Tailwind CSS

Vite is a modern, fast build tool perfect for React development. This setup includes TypeScript for type safety and Tailwind CSS for styling.

Step 1: Create a New Vite + React + TypeScript Project

Run the following command to create a new React project with Vite and TypeScript:

npm create vite@latest my-sui-dapp -- --template react-ts

Navigate into your project directory:

cd my-sui-dapp

Step 2: Install Dependencies

Install the base dependencies:

npm install

Step 3: Install Sui SDK and Dependencies

Install the Mysten Sui TypeScript SDK and wallet adapter:

npm install @mysten/sui.js @mysten/dapp-kit @mysten/wallet-standard @tanstack/react-query

Step 4: Install and Configure Tailwind CSS

Install Tailwind CSS and its peer dependencies:

npm install -D tailwindcss postcss autoprefixer

Initialize Tailwind CSS configuration:

npx tailwindcss init -p

Update your tailwind.config.js file:

/** @type {import('tailwindcss').Config} */
export default {
  content: [
    "./index.html",
    "./src/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

Add Tailwind directives to your src/index.css file:

@tailwind base;
@tailwind components;
@tailwind utilities;

Step 5: Set Up Sui dApp Kit

Update your src/main.tsx to include the Sui dApp Kit providers:

import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import { SuiClientProvider, WalletProvider } from '@mysten/dapp-kit'
import { getFullnodeUrl } from '@mysten/sui.js/client'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'

const queryClient = new QueryClient()
const networks = {
  devnet: { url: getFullnodeUrl('devnet') },
  testnet: { url: getFullnodeUrl('testnet') },
  mainnet: { url: getFullnodeUrl('mainnet') },
}

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <QueryClientProvider client={queryClient}>
      <SuiClientProvider networks={networks} defaultNetwork="testnet">
        <WalletProvider>
          <App />
        </WalletProvider>
      </SuiClientProvider>
    </QueryClientProvider>
  </React.StrictMode>,
)

Step 6: Import dApp Kit Styles

Add the dApp Kit CSS to your src/index.css at the top:

@import '@mysten/dapp-kit/dist/index.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

Step 7: Run Your Development Server

Start the development server:

npm run dev

Your React + Vite + TypeScript + Tailwind CSS project is now ready! Open your browser at http://localhost:5173


Next.js + TypeScript + Tailwind CSS

Next.js is a powerful React framework with server-side rendering and excellent developer experience.

Step 1: Create a Next.js Project

Create a new Next.js app with TypeScript and Tailwind CSS:

npx create-next-app@latest my-sui-nextjs-dapp --typescript --tailwind --app --no-src-dir --import-alias "@/*"

Navigate to your project:

cd my-sui-nextjs-dapp

Step 2: Install Sui Dependencies

Install the Sui SDK and wallet adapter:

npm install @mysten/sui.js @mysten/dapp-kit @mysten/wallet-standard @tanstack/react-query

Step 3: Create Providers Component

Since Next.js 13+ uses the App Router, create a client component for providers. Create app/providers.tsx:

'use client'

import { SuiClientProvider, WalletProvider } from '@mysten/dapp-kit'
import { getFullnodeUrl } from '@mysten/sui.js/client'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { ReactNode } from 'react'

const queryClient = new QueryClient()

const networks = {
  devnet: { url: getFullnodeUrl('devnet') },
  testnet: { url: getFullnodeUrl('testnet') },
  mainnet: { url: getFullnodeUrl('mainnet') },
}

export function Providers({ children }: { children: ReactNode }) {
  return (
    <QueryClientProvider client={queryClient}>
      <SuiClientProvider networks={networks} defaultNetwork="testnet">
        <WalletProvider>
          {children}
        </WalletProvider>
      </SuiClientProvider>
    </QueryClientProvider>
  )
}

Step 4: Update Root Layout

Update your app/layout.tsx:

import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import { Providers } from './providers'

const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
  title: 'My Sui dApp',
  description: 'Built with Next.js and Sui',
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en">
      <body className={inter.className}>
        <Providers>
          {children}
        </Providers>
      </body>
    </html>
  )
}

Step 5: Add dApp Kit Styles

Import dApp Kit CSS in your app/globals.css:

@import '@mysten/dapp-kit/dist/index.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

Step 6: Run Development Server

Start your Next.js development server:

npm run dev

Open http://localhost:3000 in your browser.


React Native + TypeScript + Sui

Build mobile dApps for iOS and Android using React Native with Sui integration.

Step 1: Create React Native Project

Create a new React Native project with TypeScript:

npx react-native@latest init MySuiMobileApp --template react-native-template-typescript

Navigate to your project:

cd MySuiMobileApp

Step 2: Install Sui SDK

Install Sui SDK and required dependencies:

npm install @mysten/sui.js @react-native-async-storage/async-storage

Step 3: Install Polyfills

React Native requires polyfills for certain Node.js modules. Install them:

npm install react-native-get-random-values react-native-url-polyfill

Step 4: Configure Polyfills

Add polyfills at the top of your index.js file (before any other imports):

import 'react-native-get-random-values';
import 'react-native-url-polyfill/auto';

import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';

AppRegistry.registerComponent(appName, () => App);

Step 5: Install NativeWind (Tailwind for React Native) - Optional

If you want Tailwind-like styling in React Native:

npm install nativewind
npm install --save-dev tailwindcss

Initialize Tailwind:

npx tailwindcss init

Update tailwind.config.js:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./App.{js,jsx,ts,tsx}",
    "./src/**/*.{js,jsx,ts,tsx}"
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

Add to your babel.config.js:

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: ['nativewind/babel'],
};

Step 6: Run on iOS or Android

For iOS (macOS only):

npx pod-install
npm run ios

For Android:

npm run android
Note: For React Native, you'll need to set up either Xcode (for iOS) or Android Studio (for Android). Mobile wallet integration requires additional setup with deep linking and wallet connect protocols.

Additional Resources


🎉

Congratulations!

You've successfully set up your Sui development environment with frontend frameworks.

You're now ready to start building amazing Sui dApps!

↑