How to Create a Solana Token Using CLI

·

Creating your own token on the Solana blockchain has never been more accessible. With the Solana Command Line Interface (CLI), developers and enthusiasts can launch custom tokens efficiently and securely—perfect for experiments, community projects, or decentralized applications. This step-by-step guide walks you through the entire process of creating a Solana token using CLI, from setting up your environment to minting and managing your token on the Solana devnet.

Whether you're new to blockchain development or expanding your Web3 toolkit, this tutorial delivers clear instructions with practical commands. By the end, you’ll have a fully functional SPL token and a deeper understanding of Solana’s ecosystem.

👉 Start building your Solana token today with powerful tools and resources.

Setting Up Your Development Environment

Before diving into token creation, ensure your system is properly configured with the necessary tools. The Solana CLI relies on Rust and other dependencies, so proper setup is essential.

Install Rust

Solana's tooling is built using Rust, so installing the Rust programming language is your first step.

  1. Visit the official Rust website: https://www.rust-lang.org
  2. Follow the installation instructions for your operating system (Windows, macOS, or Linux).
  3. On Windows, you may need to install C++ build tools. Choose option 1 during installation to set this up quickly.

After installation, verify it worked by running:

rustc --version

If a version number appears (e.g., rustc 1.75.0), Rust is successfully installed.

Download and Install Solana CLI

The Solana CLI allows you to interact with the Solana network directly from your terminal.

On Windows (Admin Command Prompt), run:

cmd /c "curl https://release.solana.com/v1.17.17/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\solana-install-tmp\solana-install-init.exe --create-dirs"

Then execute the installer:

C:\solana-install-tmp\solana-install-init.exe v1.17.17

Verify the installation:

solana -V

A successful output will display the installed version, confirming the CLI is ready.

Install SPL Token CLI

The SPL Token CLI is a critical tool for creating and managing tokens on Solana.

Run:

cargo install spl-token-cli

If you experience slow downloads due to network issues, consider switching to a Rust crate mirror—such as the Tsinghua University mirror:

[source.crates-io]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"

[http]
proxy = ""

After updating your .cargo/config file, retry the installation. Confirm success with:

spl-token -V

Configure Solana to Use Devnet

To avoid spending real SOL, we'll use Solana’s devnet, a testing environment perfect for development.

Set your CLI to connect to devnet:

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

You can verify your current configuration with:

solana config get

This should show the devnet URL and other settings.


Generate a Wallet

You’ll need a Solana wallet to deploy and manage your token.

Create a new keypair:

solana-keygen new

This command generates a wallet file (typically id.json) and displays your public address and recovery phrase. Store these securely—losing them means losing access.

Set this wallet as your default:

solana config set -k /path/to/id.json

Replace /path/to/id.json with the actual file path on your machine.

👉 Securely manage your tokens with trusted Web3 tools.


Request Test SOL Tokens

To perform transactions on devnet, you need test SOL.

Airdrop 2 test SOL to your wallet:

solana airdrop 2

Check your balance:

solana balance

You should now see 2 SOL. If the airdrop fails, retry after a few seconds—rate limits may apply.


Create Your Custom Token

Now comes the exciting part: creating your SPL token.

Run:

spl-token create-token

The output will include your new token address, for example:

AqW1METFTZaysupN8EqU6eGrQEHYRuxfg7Zu84qGyRgJ

This unique address identifies your token on the blockchain. Keep it handy—you’ll use it in all subsequent steps.


Create a Token Account

To store your newly created token, you must create an associated token account (ATA):

spl-token create-account AqW1METFTZaysupN8EqU6eGrQEHYRuxfg7Zu84qGyRgJ

Replace the address with your token’s actual address.

The command returns a new account address like:

ExBZU4EyfpsxYgQrL6BRwTV4bByF1p5woF2cfA7m1kbe

This account now holds your token balance and supports transfers.


Mint Tokens

Time to mint some tokens!

Use the following command to issue tokens to your account:

spl-token mint AqW1METFTZaysupN8EqU6eGrQEHYRuxfg7Zu84qGyRgJ 1000

This mints 1,000 tokens. You can adjust the amount as needed.

Note: By default, tokens are mintable unless explicitly disabled. Always finalize supply if you want a fixed cap.

Check Your Token Balance

Verify the mint was successful:

spl-token balance AqW1METFTZaysupN8EqU6eGrQEHYRuxfg7Zu84qGyRgJ

You should see 1000 (or your chosen amount) displayed.


Disable Further Minting

To make your token non-inflationary, disable future minting:

spl-token authorize AqW1METFTZaysupN8EqU6eGrQEHYRuxfg7Zu84qGyRgJ mint --disable

After this command, any attempt to mint more tokens will fail—ensuring your total supply remains fixed and trustworthy.

Try minting again to confirm it fails:

spl-token mint AqW1METFTZaysupN8EqU6eGrQEHYRuxfg7Zu84qGyRgJ 100

You should receive an authorization error—this is expected and secure.


View Your Token in Phantom Wallet

Want to see your token in a real wallet interface?

  1. Open Phantom Wallet.
  2. Click “Add/Import Wallet” → “Import Private Key”.
  3. Open your id.json file (generated earlier) and copy the array of numbers inside.
  4. Paste them into Phantom’s import field.
  5. Confirm import.

Your wallet will appear with test SOL and an “Unknown Token”—this is your custom SPL token! The name and symbol won’t display yet unless metadata is added (a topic for future exploration).


Frequently Asked Questions (FAQ)

Can I create a token without coding?

Yes! Using the Solana CLI, you can create a functional SPL token entirely through terminal commands—no smart contract coding required.

Is it free to create a Solana token?

Creating a token uses minimal computational resources and requires a small amount of SOL for transaction fees. On devnet, this cost is covered by free test SOL via airdrops.

What is the difference between a token and a coin on Solana?

A coin typically refers to native SOL or tokens with their own blockchain layer, while a token (like SPL tokens) exists as an asset built on top of Solana using standardized programs such as the SPL Token program.

Can I add metadata like name, symbol, and logo?

Yes, but that requires additional steps involving Metaplex and uploading JSON metadata to decentralized storage like Arweave or IPFS. That process goes beyond basic CLI usage but is commonly used for NFTs and branded tokens.

How do I transfer my token to someone else?

Use:

spl-token transfer [TOKEN_ADDRESS] [RECIPIENT_WALLET] [AMOUNT] --fund-recipient

The --fund-recipient flag automatically creates a token account for the recipient if they don’t have one.

Can I revoke ownership or freeze accounts?

Yes—the token authority can freeze specific accounts or revoke its own permissions using advanced spl-token authorize commands. However, once permissions are removed, they cannot be recovered unless re-enabled via custom logic.


By following this guide, you've successfully created a custom Solana token using CLI, deployed it on devnet, minted supply, and secured it against inflation. This foundation opens doors to building DeFi projects, launching community tokens, or experimenting with Web3 mechanics.

As blockchain technology evolves, mastering tools like the Solana CLI gives you an edge in innovation and decentralization.

👉 Explore more blockchain development tools and elevate your Web3 journey.

Core Keywords: Solana token, SPL token, create Solana token, Solana CLI, SPL Token CLI, mint token on Solana, blockchain development, Web3