> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Deploying Programs

> What to check before and during a mainnet program deployment: the program keypair, initial accounts, buffer accounts, upgrade authority, rent, and verified builds.

If you're deploying a custom Solana program as part of your payment
infrastructure, there are additional considerations.

## Pre-deployment

- **Solana CLI version:** Ensure you are using the latest version of the
  [Solana CLI](/developers/docs/quickstart).
- **Program keypair:** Your program will have a different address on mainnet
  than devnet (unless you're reusing the same keypair). Update all references in
  your application config. Store your program keypair in a secure location (note
  that running `cargo clean` will likely delete your program keypair).
- **Initialize accounts:** If your program requires admin accounts, PDAs, or
  other state accounts, ensure these are created on mainnet before users
  interact with your application. Same for any Associated Token Accounts (ATAs)
  your program needs.

## Deployment Process

- **Buffer accounts:** Large programs deploy via buffer accounts. The
  `solana program deploy` command handles this automatically, but understand
  that deployment isn't atomic—if interrupted, you may need to recover or close
  buffer accounts.
- **Upgrade authority:** Create a
  [multisig](https://docs.squads.so/main/basics/what-is-a-multisig) and assign
  it as the
  [upgrade authority of your Solana program](https://docs.squads.so/main/navigating-your-squad/developers-assets/programs).
- **Rent:** Ensure your deployment wallet has enough SOL to cover rent-exempt
  minimums for all program accounts.
- **Verification:** [Verify](/developers/docs/programs/verified-builds)
  your program to ensure that the executable program you deploy to Solana’s
  network matches the source code in your repository

The [program deployment guide](/developers/docs/programs/deploying) has the
Solana CLI commands to deploy, upgrade, transfer the upgrade authority, make a
program immutable, and close it.
