Skip to content
This section provides common commands and examples to help you get started with the Solana CLI.

​Solana config

Your Solana config specifies the following variables:
  • Config file: The path to your config file
  • RPC URL & Websocket URL: The Solana cluster to which the CLI makes requests
  • Keypair path: The path to the default Solana wallet (keypair) used to pay transaction fees and deploy programs. By default, this file is stored at ~/.config/solana/id.json.
To see your current configuration settings, run:
Terminal
A successful command will return output similar to the following:
Example output
You can change the Solana CLI cluster with the following commands:
Terminal

​Create a wallet

Before you can send transactions using the Solana CLI, you need a Solana wallet funded with SOL. To generate a keypair at the default keypair path, run the following command:
Terminal
A successful command will return output similar to the following:
Example output
This command will not override an existing account at the default location, unless you use the --force flag.
To view your wallet’s address (public key), run:
Terminal

​Airdrop SOL

Your wallet needs SOL to pay for transactions and program deployments. On devnet, get free test SOL from the Solana Faucet.
  1. Set your cluster to devnet:
Terminal
  1. Print your wallet address, paste it into the Solana Faucet, and request devnet SOL:
Terminal
The devnet RPC faucet is closed, so solana airdrop on devnet fails with airdrop request failed. This can happen when the rate limit is reached. solana airdrop 2 still works against a local validator (solana config set -ul). See Airdrops and faucets for other ways to get test SOL.
To check your wallet’s SOL balance, run the following command:
Terminal