Development Environment Setup
This chapter provides detailed instructions for setting up a complete Solana development environment. We'll configure everything you need for both client-side development and on-chain program development.
Overview
A complete Solana development setup includes:
| Component | Purpose |
|---|---|
| Node.js + Bun | JavaScript/TypeScript runtime and package manager |
| Rust + Cargo | On-chain program development |
| Solana CLI | Blockchain interaction and local validator |
| Anchor | Program development framework |
| IDE Setup | Code editor with proper extensions |
Detailed Installation Guide
macOS Setup
macOS is the most straightforward platform for Solana development.
Install Homebrew (if not installed)
Install Dependencies
Install Rust
Install Solana CLI
Linux Setup (Ubuntu/Debian)
Install System Dependencies
Install Rust
Install Solana CLI
Windows Setup (WSL 2)
Windows users should use WSL 2 (Windows Subsystem for Linux).
Enable WSL 2
Install Ubuntu
Configure Ubuntu
After Ubuntu installs and you create a user, follow the Linux setup instructions above.
Node.js and Bun Setup
Install Node.js via nvm
Install Bun
Anchor Framework Setup
Anchor is the standard framework for Solana program development.
Install Anchor Version Manager (avm)
Troubleshooting Anchor Installation
If you encounter issues:
Solana CLI Configuration
Configure for Development
Understanding Networks
| Network | URL | Purpose |
|---|---|---|
| Mainnet | https://api.mainnet-beta.solana.com | Production |
| Devnet | https://api.devnet.solana.com | Development & testing |
| Testnet | https://api.testnet.solana.com | Validator testing |
| Localnet | http://localhost:8899 | Local development |
Get Devnet SOL
Local Validator Setup
For faster development, run a local Solana validator:
Validator Options
VS Code Setup
Install VS Code Extensions
Configure rust-analyzer
Create .vscode/settings.json in your project:
Project Templates
Create a New Anchor Project
Create a Client-Only Project
Environment Verification Script
Create and run this script to verify your setup:
Common Issues and Solutions
"Error: insufficient funds for rent"
Your account doesn't have enough SOL:
"Error: Transaction simulation failed"
Usually a program error. Check:
- Correct account permissions
- Sufficient lamports
- Valid account data
"rust-analyzer not working"
"Anchor build fails"
Next Steps
Your development environment is ready! You can now:
- Continue with the handbook from Blockchain History
- Jump to Your First Solana Transaction for hands-on coding
- Start with Anchor Framework if you want to build programs
Choose your path based on your goals and experience level.