Summary
Solana Devnet is a free, public test network where developers can deploy programs, test transactions, and simulate mainnet behavior without using real SOL. It mirrors the Solana runtime closely, making it the standard environment for building and debugging dApps before mainnet launch.
This guide covers how to connect to Devnet, get free SOL from the faucet, and choose a reliable RPC endpoint. You'll also learn how to debug transactions and decide when Devnet is the right environment for your project.
Quick decision guide: Is Devnet the right environment for you?
Before you dive into setup, it helps to confirm that Devnet is the environment you actually need. Solana runs three public clusters, and each serves a different purpose:
| Cluster | Purpose | SOL value | Who uses it |
|---|---|---|---|
| Devnet | Application development and testing | Free (fake) | dApp developers, QA teams |
| Testnet | Protocol and validator testing | Free (fake) | Validators, core contributors |
| Mainnet-beta | Production traffic | Real money | End users, production dApps |
If you are building a dApp, writing smart contracts, or running integration tests, Devnet is the right choice. If you are testing validator behavior or protocol upgrades, Testnet is more appropriate. If you are ready to ship, you will need mainnet.
Once you confirm Devnet fits, the next decision is how to connect. You can use the public endpoint, run your own node, or use a managed RPC service. For most development work, a managed endpoint removes the overhead of syncing and maintaining a node, letting you focus on code. OnFinality provides a Solana Devnet RPC endpoint that you can use for free during development.
What is Solana Devnet?
Solana Devnet is a public test network that mirrors the Solana mainnet runtime. It uses the same software, the same account model, and the same transaction processing pipeline, but it runs with fake SOL that has no monetary value. This makes it a safe sandbox for deploying programs, testing token transfers, and debugging edge cases without financial risk.
Devnet is reset periodically, so you should not treat it as a persistent environment. The reset schedule is announced by the Solana team, and after a reset, all accounts and balances are wiped. This is one reason why you should keep your deployment scripts and configuration in version control.
Devnet vs Testnet vs Mainnet: which one to use
Solana's three clusters are often confused, but they serve distinct roles:
- Devnet is for application developers. It is the closest thing to mainnet in terms of runtime behavior, and it is where you test your dApp end-to-end.
- Testnet is for validator operators and protocol developers. It runs the latest protocol changes and is used to test consensus and network upgrades.
- Mainnet-beta is the production network. It uses real SOL and is where your users interact with your deployed application.
For most Web3 developers, Devnet is the starting point. It gives you a realistic environment without the cost or risk of mainnet.
How to connect to Solana Devnet
There are several ways to connect to Devnet, depending on your tooling. The most common are the Solana CLI, JavaScript libraries like @solana/web3.js, and wallet configurations.
Using the Solana CLI
The Solana CLI lets you switch your active cluster to Devnet with a single command:
solana config set --url devnet
You can verify the configuration with:
solana config get
The output should show RPC URL: https://api.devnet.solana.com (the default public endpoint). If you prefer to use a managed endpoint, you can set the URL explicitly:
solana config set --url https://solana-devnet.api.onfinality.io/public
Replace the URL with the endpoint you want to use. OnFinality's Solana Devnet network page lists the current public endpoint.
Using JavaScript (web3.js)
If you are building a dApp with JavaScript, you can create a Connection object pointing to Devnet:
import { Connection, clusterApiUrl } from '@solana/web3.js';
const connection = new Connection(clusterApiUrl('devnet'), 'confirmed');
For a custom endpoint, pass the URL directly:
const connection = new Connection('https://solana-devnet.api.onfinality.io/public', 'confirmed');
Using a wallet (Phantom, Solflare)
Most Solana wallets support Devnet in their developer settings. For example, in Phantom:
- Open Settings → Developer Settings.
- Enable Testnet Mode.
- Select Devnet.
Your wallet address stays the same across clusters, but balances are separate. You will need to airdrop Devnet SOL to your address before you can pay transaction fees.
Getting free SOL from the Devnet faucet
Devnet transactions require SOL for fees, but the SOL is free. The official Solana Devnet Faucet is the most reliable source. It allows a limited number of requests per IP address, and you can increase your limit by connecting a GitHub account.
You can also request an airdrop directly from the CLI:
solana airdrop 1 <YOUR_WALLET_ADDRESS> --url devnet
The CLI airdrop is convenient, but it may be rate-limited. If you need a larger amount for testing, the web faucet is usually a better option.
Choosing a Devnet RPC endpoint
Your RPC endpoint is the gateway between your dApp and the Devnet cluster. The default public endpoint (https://api.devnet.solana.com) works for light usage, but it can become congested during peak times. For serious development, consider a managed RPC provider.
When evaluating an RPC provider for Devnet, compare these factors:
| Factor | What to check | Why it matters |
|---|---|---|
| Rate limits | Requests per second and daily quota | Prevents your app from being throttled during testing |
| Uptime | Historical availability | Ensures your CI/CD pipeline does not fail due to endpoint downtime |
| WebSocket support | Real-time subscription support | Needed for account and program subscriptions |
| Archive data | Access to historical state | Useful for debugging and analytics |
| Dedicated options | Private endpoint or dedicated node | Isolates your traffic from noisy neighbors |
OnFinality offers both shared and dedicated node options for Solana Devnet. You can start with the free public endpoint and upgrade as your testing needs grow. See our RPC pricing for details.
Debugging common Devnet issues
Even with a reliable endpoint, you will run into issues. Here are the most common problems and how to fix them:
Transaction simulation errors
If a transaction fails during simulation, the error message often points to the instruction that failed. Use the Solana Explorer to inspect the transaction and look for the specific error code.
Insufficient balance
If you see insufficient funds, your wallet does not have enough Devnet SOL. Use the faucet to airdrop more SOL to your address.
Rate limiting
If you get 429 Too Many Requests, you are hitting the rate limit of your RPC endpoint. Reduce your request frequency or switch to a provider with higher limits.
WebSocket disconnects
WebSocket connections can drop if the endpoint is overloaded. Implement reconnection logic in your client to handle this gracefully.
Key Takeaways
- Solana Devnet is a free test network for building and testing dApps without real SOL.
- Use Devnet for application development, Testnet for protocol testing, and Mainnet for production.
- Connect via CLI, JavaScript, or wallet settings; choose an RPC endpoint that fits your workload.
- Get free SOL from the official faucet or via CLI airdrop.
- Evaluate RPC providers on rate limits, uptime, WebSocket support, and dedicated options.
- Debug transaction failures using the Solana Explorer and check for common issues like insufficient balance or rate limiting.
Frequently Asked Questions
What is the difference between Solana Devnet and Testnet?
Devnet is for application developers to test dApps and smart contracts. Testnet is for validator operators and core developers to test protocol upgrades and network behavior.
How do I get free SOL on Devnet?
Use the official Solana Devnet Faucet or run solana airdrop from the CLI. Both methods provide free SOL for testing.
Can I use the same wallet address on Devnet and Mainnet?
Yes, your wallet address is the same across all Solana clusters, but balances are separate. You need to airdrop Devnet SOL to your address for Devnet transactions.
Is Devnet reset?
Yes, Devnet is periodically reset by the Solana team. All accounts and balances are wiped, so do not rely on Devnet for persistent state.
What RPC endpoint should I use for Devnet?
The default public endpoint works for light testing, but for production-grade development, consider a managed RPC provider like OnFinality. Check the Solana Devnet network page for the current public endpoint and options.