Skip to main content
Deploy to Stacks testnet to test your dApp with real network conditions before mainnet.

Contents

Requirements

Get testnet tokens

  1. Visit the Hiro testnet faucet
  2. Request STX and sBTC
  3. Add your mnemonic to Testnet.toml:

Deploy to testnet

Preview without broadcasting:
Deploy a single contract:
This generates a deployment plan, submits transactions, and updates deployments.json.

Start frontend

Opens at http://localhost:3000 connected to testnet.

Test interactions

  • Connect Leather or Xverse (set to Testnet)
  • Use the debug UI to call contract functions
  • Verify wallet prompts and confirmations

Redeploy after changes

Contracts are immutable. Changes create new versions:
The CLI handles versioning automatically.

Troubleshooting

Transaction failures

  • Check gas fees
  • Verify mnemonic and derivation path
  • Ensure sufficient testnet balance

Contract errors

  • Run stacksdapp check for syntax validation
  • Test locally with devnet first
  • Check contract requirements

Frontend issues

  • Verify network configuration in .env.local
  • Check browser console for errors
  • Ensure wallet is set to testnet