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.
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:
- Node.js (v22 recommended)
- nvm (Node Version Manager) or fnm (Fast Node Manager)
- pnpm (faster alternative to npm)
- Rust
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 --versionIf 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.
macOS:
echo 'export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"' >> ~/.zshrc source ~/.zshrcLinux/WSL:
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
Verify installation:
solana --versionYou 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.comOutput includes:
- RPC URL: Confirms connection to Devnet
- Keypair Path: Location of your wallet file
- Commitment Level: Set to
confirmed(fast finality)
Check configuration:
solana config getTest connectivity:
solana cluster-versionThis 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.jsonKeep safe:
- The public key (safe to share)
- The seed phrase (12 BIP39 words—never disclose)
Set it as active:
solana config set --keypair ~/wallet-dev.jsonConfirm address:
solana addressIt should match the pubkey from generation.
Get Free Devnet SOL via Airdrop
Your wallet starts empty. Request test SOL using:
solana airdrop 1Due to rate limits:
- You may receive only 1–2 SOL per hour.
- Avoid using VPNs or shared networks.
If airdrops fail, try the official Solana Faucet (up to 5 SOL every 8 hours after GitHub login).
Check balance:
solana balanceSuccess? You now have test funds!
Basic CLI Commands for Information
Explore the network with simple queries:
Block time:
solana block-timeUseful for time-based apps or games.
Epoch info:
solana epoch-infoTrack staking cycles or event schedules.
Supply check:
solana supplyView circulating vs. total SOL on Devnet.
List all commands:
solanaSend a Test Transaction
Verify everything works by sending SOL:
solana transfer <RECIPIENT_ADDRESS> 0.01 --no-waitEven sending to yourself counts! Check updated balance:
solana balanceNotice 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:
- Status (confirmed)
- Sender and receiver addresses
- Timestamp and fee
Other explorers include:
- explorer.solana.com
- solana.fm
- Helius Orb (beta)
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 installKey features:
mucho balance: Check balances across clustersmucho inspect: View transactions/accounts in CLImucho info: Diagnose your setup
Check version:
mucho --versionWhile optional, Mucho enhances productivity—especially as projects grow.
Bonus: Hidden CLI Tips & Resources
Solana’s CLI has lesser-known commands worth exploring:
solana program dump: Download compiled programssolana resolve-signer: Handle signer files securely
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.
🔥 You're on the edge of something big—welcome to the Solana ecosystem.