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:
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).
The Linux OS requires the following prerequisites:
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
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
We use the APT package manager, so let's go ahead and make sure it's updated:
sudo apt-get update
Run the following command to install Git, including the Git CLI:
sudo apt-get install git-all
Use the following command to install CMake:
sudo apt-get install cmake
Use the following command to install the GNU Compiler Collection, gcc:
sudo apt-get install gcc
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
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
Use the following command to install build-essential:
sudo apt-get install build-essential
Proceed to Installing Sui Binaries
The macOS requires the following prerequisites:
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)"
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
brew install curl
Use the following command to install CMake:
brew install cmake
Use the following command to install Git:
brew install git
Proceed to Installing Sui Binaries
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:
However if you face challenges using that method you can use the Chocolatey method or the Manual method
| 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 |
| 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 |
If you decide to use the WSL method you can go ahead and proceed installing the following prerequisites:
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
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.
Download and install CMake from the CMake website.
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.
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.
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.
GitHub will now set up your development environment â including VS Code in the browser.
Once it loads:
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.
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
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.
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.
You can now:
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:
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.
Sui's Discord server offers a faucet bot for Testnet & Devnet tokens.
#testnet-faucet or
#devnet-faucet channel.
!faucet <your-address>
For example to request from this wallet,
0xd8133d487f2bd59baf4906ba1b76e29504dd8ab7900a2b1ff4d489eab88d59b1
this is how the command would look like:
!faucet 0xd8133d487f2bd59baf4906ba1b76e29504dd8ab7900a2b1ff4d489eab88d59b1
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.
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.
node --version and npm --version.
Vite is a modern, fast build tool perfect for React development. This setup includes TypeScript for type safety and Tailwind CSS for styling.
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
Install the base dependencies:
npm install
Install the Mysten Sui TypeScript SDK and wallet adapter:
npm install @mysten/sui.js @mysten/dapp-kit @mysten/wallet-standard @tanstack/react-query
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;
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>,
)
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;
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 is a powerful React framework with server-side rendering and excellent developer experience.
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
Install the Sui SDK and wallet adapter:
npm install @mysten/sui.js @mysten/dapp-kit @mysten/wallet-standard @tanstack/react-query
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>
)
}
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>
)
}
Import dApp Kit CSS in your app/globals.css:
@import '@mysten/dapp-kit/dist/index.css'; @tailwind base; @tailwind components; @tailwind utilities;
Start your Next.js development server:
npm run dev
Open http://localhost:3000 in your browser.
Build mobile dApps for iOS and Android using React Native with Sui integration.
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
Install Sui SDK and required dependencies:
npm install @mysten/sui.js @react-native-async-storage/async-storage
React Native requires polyfills for certain Node.js modules. Install them:
npm install react-native-get-random-values react-native-url-polyfill
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);
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'],
};
For iOS (macOS only):
npx pod-install npm run ios
For Android:
npm run android
You've successfully set up your Sui development environment with frontend frameworks.
You're now ready to start building amazing Sui dApps!