Skip to content
ICP CLI
Feedback welcome! Report issues on GitHub, ask questions on the Forum, or chat with us on Discord.

Local Development

This guide covers the day-to-day development workflow with icp-cli.

The Development Cycle

Local development follows a simple loop:

Edit code → Build → Deploy → Test → Repeat

Starting Your Session

Start the local network in the background:

Terminal window
icp network start -d

Verify it’s running:

Terminal window
icp network ping

Making Changes

After editing your source code, deploy the changes:

Terminal window
icp deploy

This rebuilds and redeploys all canisters. Deploy specific canisters:

Terminal window
icp deploy my-canister

Tip: icp deploy always builds first. If you want to verify compilation before deploying, run icp build separately.

Testing Changes

Call methods on your canister:

Terminal window
icp canister call my-canister method_name '(arguments)'

Example:

Terminal window
icp canister call backend get_user '("alice")'

Viewing Project State

List canisters configured in this environment (the local environment is the default, targeting your local network):

Terminal window
icp canister list

View the effective project configuration:

Terminal window
icp project show

Working with Multiple Canisters

Deploy all canisters:

Terminal window
icp deploy

Deploy specific canisters:

Terminal window
icp deploy frontend
icp deploy backend

Build without deploying (for verification):

Terminal window
icp build # Build all
icp build frontend # Build specific canister

Resetting State

To start fresh with a clean network:

Terminal window
# Stop the current network
icp network stop
# Start a new network (previous state is discarded)
icp network start -d

Then redeploy your canisters:

Terminal window
icp deploy

Network Management

Check network status:

Terminal window
icp network status

View network details as JSON:

Terminal window
icp network status --json

Stop the network when done:

Terminal window
icp network stop

Troubleshooting

Build fails with “command not found”

A required tool is missing. See the Installation Guide for:

  • Rust toolchain — If error mentions cargo or rustc
  • Motoko toolchain — If error mentions moc or mops
  • ic-wasm — If error mentions ic-wasm

Network connection fails

Check if the network is running:

Terminal window
icp network ping

If not responding, restart:

Terminal window
icp network stop
icp network start -d

Deployment fails

  1. Verify the build succeeded: icp build
  2. Check network health: icp network ping

Next Steps

Browse all documentation →