Solana Dev Setup Guide (Part 1: CLI)

·

Setting up a development environment for Solana doesn’t have to be overwhelming. This guide walks you through the essential steps to get your Solana CLI up and running—quickly, efficiently, and with zero cost using Solana Devnet.

We focus on practical, hands-on setup so you can start building fast, cheap, and fun blockchain projects without getting bogged down in theory. Whether you're new to Solana or brushing up your skills, this step-by-step walkthrough ensures you're ready for what's next: creating dApps, smart contracts, and interactive tools on one of the fastest blockchains today.

Let’s dive in.


Why Start with the Solana CLI?

The Solana Command Line Interface (CLI) is your gateway to interacting directly with the Solana blockchain. It's lightweight, powerful, and foundational for any developer journey on Solana. By starting here, you install core dependencies—Node.js, Rust, and more—that will power future projects involving frontend frameworks like Next.js or on-chain programs written in Rust/Anchor.

👉 Generate highly click-attractive anchor text here based on article context and anchor link characteristics; no brand names other than 'OKX' may appear here.

Unlike browser-based wallets such as Phantom or Backpack, the CLI gives you granular control over accounts, transactions, and configurations—all from your terminal. Plus, it requires no coding at this stage, making it the perfect entry point.

We'll use Solana Devnet, a free sandbox environment that mirrors mainnet behavior but uses test SOL instead of real funds. This lets you experiment safely while learning how real blockchain interactions work.


Core Prerequisites: Node.js, pnpm, and Rust

Before installing the Solana CLI, ensure these tools are set up:

These are required not only for the CLI but also for future development tasks like writing scripts or compiling on-chain programs.

Check Your Current Installations

Run these commands in your terminal:

node -v
nvm -v  # or fnm --version on Windows
pnpm -v
rustc --version

If all return version numbers, you're good to proceed.

Note for Windows users: Use Windows Subsystem for Linux (WSL) as recommended by Solana developers. This ensures compatibility and smoother operation.

Install Missing Tools

For macOS (using nvm):

# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

# Load nvm
source "$HOME/.nvm/nvm.sh"

# Install Node.js v22
nvm install 22

# Enable pnpm via Corepack
corepack enable pnpm

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"

For Windows (using WSL + fnm):

# Install fnm
winget install Schniz.fnm

# Install Node.js
fnm install 22

# Enable pnpm
corepack enable pnpm

# Install Rust (same as above)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"

✅ Once done, recheck versions to confirm successful installation.


Install the Solana CLI

The Solana CLI is maintained by Anza and serves as your primary tool for blockchain interaction.

Install it with:

sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"

Add CLI to PATH

This makes the solana command available globally.

Verify installation:

solana --version

You should see output like: solana-cli 2.1.16.


Configure CLI for Solana Devnet

Point your CLI to Devnet so all actions occur in the test environment:

solana config set --url https://api.devnet.solana.com

Output includes:

Check configuration:

solana config get

Test connectivity:

solana cluster-version

This confirms your node is synced with the Devnet cluster.


Create a Devnet Wallet

You’ll generate a keypair—a JSON file storing both public and private keys.

⚠️ Security Note: This file is unencrypted. Never use it with real funds.

Generate a wallet:

solana-keygen new --outfile ~/wallet-dev.json

Keep safe:

Set it as active:

solana config set --keypair ~/wallet-dev.json

Confirm address:

solana address

It should match the pubkey from generation.


Get Free Devnet SOL via Airdrop

Your wallet starts empty. Request test SOL using:

solana airdrop 1

Due to rate limits:

If airdrops fail, try the official Solana Faucet (up to 5 SOL every 8 hours after GitHub login).

Check balance:

solana balance

Success? You now have test funds!


Basic CLI Commands for Information

Explore the network with simple queries:

List all commands:

solana

Send a Test Transaction

Verify everything works by sending SOL:

solana transfer <RECIPIENT_ADDRESS> 0.01 --no-wait

Even sending to yourself counts! Check updated balance:

solana balance

Notice a small deduction—this is the transaction fee.


View Transaction on Solscan.io

Go to Solscan.io, switch to Devnet, and paste your transaction signature.

You’ll see:

Other explorers include:


Introducing Mucho: The Solana Toolkit (Beta)

A new CLI helper called Mucho simplifies common tasks like building, deploying, and inspecting programs.

Install it:

npx -y mucho@latest install

Key features:

Check version:

mucho --version

While optional, Mucho enhances productivity—especially as projects grow.

👉 Generate highly click-attractive anchor text here based on article context and anchor link characteristics; no brand names other than 'OKX' may appear here.


Bonus: Hidden CLI Tips & Resources

Solana’s CLI has lesser-known commands worth exploring:

Stay updated via:


Frequently Asked Questions (FAQ)

Q: Can I use mainnet instead of Devnet?

A: Not recommended for beginners. Devnet is free and safe for learning. Mainnet involves real money and irreversible mistakes.

Q: Why do airdrops sometimes fail?

A: Rate limiting protects the network. Try again later or use the web faucet at faucet.solana.com.

Q: Is the CLI wallet secure?

A: No—it’s unencrypted. Only use it with Devnet SOL. For mainnet, use encrypted wallets like Phantom.

Q: Do I need Rust if I'm only doing frontend work?

A: Yes—Rust underpins many Solana tools. Even frontend devs benefit from understanding backend compilation.

Q: Can I skip the CLI and use GUI tools?

A: You can, but CLI knowledge gives deeper insight into how transactions and programs work—valuable for debugging.

Q: What comes after this setup?

A: Next steps include setting up JavaScript/TypeScript environments and learning Anchor for Rust-based smart contracts.


Final Thoughts

You’ve now completed the foundational setup for Solana development:
✅ Installed Node.js, Rust, and pnpm
✅ Set up the Solana CLI
✅ Created a Devnet wallet
✅ Received test SOL
✅ Sent a transaction and verified it

This groundwork prepares you for building real applications—whether DeFi tools, NFT mints, or Web3 games.

Stay tuned for Part 2: integrating Node.js, TypeScript, and Next.js into your Solana workflow.

👉 Generate highly click-attractive anchor text here based on article context and anchor link characteristics; no brand names other than 'OKX' may appear here.

🔥 You're on the edge of something big—welcome to the Solana ecosystem.