Skip to main content
This command is deprecated since version 0.32.0. Use anchor program deploy instead for more control and features.

Overview

The anchor deploy command deploys each program in the workspace to the configured Solana cluster.

Command Syntax

anchor deploy [OPTIONS] [-- <SOLANA_ARGS>...]

Migration

Instead of:
anchor deploy
Use:
anchor program deploy
See the Program Commands documentation for the full feature set.

Options

--program-name
string
Deploy only this program
--program-keypair
string
Keypair of the program (filepath)Requires --program-name to be specified
--verifiable
flag
default:"false"
Deploy from path target/verifiable instead of target/deploy
--no-idl
flag
default:"false"
Don’t upload IDL during deployment (IDL is uploaded by default)
solana_args
string
Arguments to pass to the underlying solana program deploy command

Examples

Deploy All Programs

anchor deploy

Deploy Specific Program

anchor deploy --program-name my_program

Deploy with Custom Keypair

anchor deploy --program-name my_program --program-keypair ./keys/program-keypair.json

Deploy Verifiable Build

anchor build --verifiable
anchor deploy --verifiable

Deploy Without IDL

anchor deploy --no-idl

Pass Solana CLI Arguments

anchor deploy -- --with-compute-unit-price 1000

Deployment Process

  1. Reads program configuration from Anchor.toml
  2. Runs pre-deploy hooks (if configured)
  3. Deploys each program binary to the cluster
  4. Uploads IDL for each program (unless --no-idl)
  5. Runs post-deploy hooks (if configured)

Configuration

Programs are configured in Anchor.toml:
[programs.localnet]
my_program = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"

[programs.devnet]
my_program = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"

Cluster Selection

The deployment cluster is determined by the provider configuration:
[provider]
cluster = "devnet"  # Or "localnet", "mainnet-beta", custom URL
wallet = "~/.config/solana/id.json"
Override the cluster with:
anchor deploy --provider.cluster devnet

IDL Upload

By default, the IDL is uploaded during deployment, making it available on-chain for clients to fetch. This allows:
  • Automatic client generation
  • Type-safe interactions
  • On-chain program introspection

Upgrade Authority

The wallet specified in Anchor.toml must be the upgrade authority for the program. On first deployment, this wallet becomes the upgrade authority automatically.

Notes

Always verify you’re deploying to the correct cluster before running this command. Deployments to mainnet-beta are irreversible.
The deprecation warning will be shown each time you run anchor deploy. Migrate to anchor program deploy for continued support.
Use anchor program show <PROGRAM_ID> to view deployment information after deploying.

See Also

Build docs developers (and LLMs) love