Post
Share your knowledge.

Sui Local Dev Setup: Step-by-Step Move + CLI + TypeScript Guide
Why this problem happens (short):** Sui introduces a new toolchain (Move + Sui CLI + Sui node), and web SDKs and CLI tools are evolving quickly. Missing dependencies, mismatched versions, or not running the right local services cause confusing errors such as RPC connection refused, Move compile errors, or transaction publish failures.
Outcome: After following this guide you will have a working local Sui single-node devnet, the Move toolchain usable for Sui, and a TypeScript project able to compile, publish, and interact with a simple Move package on your local node.
1) Choose your OS & prerequisites (explicit)
Sui development works on macOS and Linux; Windows is possible via WSL. Install these first:
- Node.js (LTS recommended; v18+). Check with
node -v. - pnpm or
npm(pnpm is used when building SDKs from source).npm i -g pnpm. - Rust toolchain (stable) — required for building some native components and Move internals:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default stable
- Git and
make/build essentials. These are standard—Sui docs list required dependencies. ([docs.sui.io][1], [GitHub][2])
2) Install Sui binaries (option A: official release, option B: local build)
A. Quick: Use official release binaries
Go to the Sui GitHub releases and download the appropriate sui binary for your OS. Extract and put sui on your PATH. Example (Linux/macOS):
# example — replace with real release URL from GitHub
wget https://github.com/MystenLabs/sui/releases/download/vX.Y.Z/sui-X.Y.Z-x86_64-unknown-linux-gnu.tar.gz
tar -xzf sui-*.tar.gz
sudo mv sui /usr/local/bin/
sui --version
B. From source (recommended if you want latest dev tools) Clone the repo and build:
git clone https://github.com/MystenLabs/sui.git
cd sui
# use pnpm to build SDKs and tools if required
pnpm install
pnpm -w run build
# build sui binaries (follow repo README — may require cargo/rust)
Building from source gives you dev utilities like the latest sui CLI. The Sui repo README has up-to-date commands. ([GitHub][2])
3) Start a local devnet node (single-node devnet)
The simplest way to iterate is the provided local network script. From the Sui repo or using sui binary:
# inside repo (scripts may change — check README)
./scripts/run-local-network.sh
# or if using installed binary:
sui start --config-path ./devnet/config.yaml # example args — check release docs
A healthy local node will expose an RPC endpoint (commonly http://127.0.0.1:9000) and a faucet or initial funded accounts for testing. Confirm with:
curl http://127.0.0.1:9000/ /* or use the SDK to get node info */
If the RPC rejects, check firewall and the node logs. ([docs.sui.io][1])
4) Install Move toolchain for Sui
Sui uses a Move variant. Use the Move Book / Sui docs for the recommended toolchain. Two common flows:
Via Sui CLI (preferred) — the sui dev tooling bundles Move build/test commands:
# in a Move package directory
sui move build
sui move test
Manual Move toolchain — install via Move Book instructions if you need the standalone Move tool. The Move Book is the canonical language reference. ([move-book.com][3], [docs.sui.io][4])
5) Create a simple Move package and build
Create a directory hello_move with Move.toml or package.yaml per Sui templates (use sui move init if available). Example file layout:
hello_move/
Move.toml
sources/
Hello.move
Minimal Hello.move:
module MyProject::Hello {
struct Greeting has key { text: vector<u8> }
public fun new_greeting(sender: &signer, msg: vector<u8>) {
move_to(sender, Greeting { text: msg });
}
}
Then build:
sui move build
Address build errors by matching Sui docs’ required Move capability/abilities. ([docs.sui.io][4])
6) Install TypeScript SDK and scaffold a small project
From your project root:
npm init -y
npm i @mysten/sui
npm i ts-node typescript
Create index.ts:
import { JsonRpcProvider, devnetConnection } from '@mysten/sui';
const provider = new JsonRpcProvider(devnetConnection);
// get node info and chain id
async function main(){
const nodeInfo = await provider.getRpcApiVersion();
console.log('RPC api version:', nodeInfo);
}
main();
Run with npx ts-node index.ts. Use official SDK docs for precise API names — SDKs evolve and exact import paths may change. ([Mysten Labs TypeScript SDK Docs][5])
7) Publish your Move package (CLI or SDK)
Using CLI:
sui client publish --path ./hello_move --gas-budget 100000000
Using TypeScript SDK — build package bytes then call publish APIs (refer to SDK quickstart). After publish you will see module IDs and object IDs created on chain. ([Mysten Labs TypeScript SDK Docs][5], [docs.sui.io][6])
8) Test and iterate
- Run
sui move testfor unit tests. - Use the TypeScript SDK to sign transactions (wallet adapters exist for browser wallets).
- When debugging, inspect node logs and
sui clienttransaction output.
Troubleshooting checklist (common errors & fixes)
- RPC connection refused: Is the local node running? Confirm port and host.
- Move build errors: Ensure you used the Sui Move version expected by the
suibinary (toolchain mismatch). Update Sui CLI if needed. - Publish failures: Ensure you have a funded test account (local devnet provides faucet coins) and set gas budget properly. ([docs.sui.io][1], [GitHub][2])
Further reading & references
- Sui docs — Concepts & Local Setup. ([docs.sui.io][1])
- Sui TypeScript SDK Quickstart. ([Mysten Labs TypeScript SDK Docs][5])
- The Move Book and Sui-specific Move concepts. ([move-book.com][3], [docs.sui.io][4])
- Sui
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.
- How to Maximize Profit Holding SUI: Sui Staking vs Liquid Staking616
- Why does BCS require exact field order for deserialization when Move structs have named fields?65
- Multiple Source Verification Errors" in Sui Move Module Publications - Automated Error Resolution55
- Sui Move Error - Unable to process transaction No valid gas coins found for the transaction419
- Sui Transaction Failing: Objects Reserved for Another Transaction410