AlgoKit LocalNet | Algorand Developer Portal
AlgoKit LocalNet
The AlgoKit LocalNet feature allows you to manage (start, stop, reset, manage) a locally sandboxed private Algorand network, enabling interaction and deployment of changes against your own Algorand network without needing to worry about funding TestNet accounts or public visibility of submitted information.
AlgoKit LocalNet uses optimized Docker images for a great development experience, ensuring that images are small, start quickly, and have enabled developer-centric features like KMD for programmatically getting faucet private keys.
The philosophy of AlgoKit LocalNet is to treat it as an ephemeral network—don't store recoverable data, as resets may happen at any time despite efforts to minimize this.
For details on executing
algokit localnetwithoutdockerorpodmanrefer to the codespaces section.
Prerequisites
AlgoKit LocalNet relies on Docker and Docker Compose. You can use Podman as a Docker replacement. Install Docker following the official instructions and ensure Docker Compose is installed.
For Windows users, WSL 2 needs to be installed, which can be done by following the official installation instructions. Windows 10 should be updated to the latest version to avoid installation issues.
Alternatively, the Hyper-V backend can be used on Windows 10/11 Pro+.
Podman support
If you prefer Podman as a container engine, install and configure it first, then set it as the default container engine with algokit config container-engine podman.
Known issues
The AlgoKit LocalNet is built with 30,000 pre-generated participation keys. Once 30,000 rounds are reached, it will no longer accept new rounds. At that point, you can reset the LocalNet to continue development.
Supported operating environments
AlgoKit LocalNet is supported on Windows, Linux, and Mac on Intel, AMD chipsets, and Apple Silicon, relying on official Algorand Docker images for Indexer, Conduit, and Algod.
Container-based LocalNet
AlgoKit CLI supports both Docker and Podman for container engines, with Docker being the default.
Creating / Starting the LocalNet
To create/start an instance, run algokit localnet start. This command:
- Detects if Docker and Docker Compose are installed.
- Checks if the Docker engine is running.
- Creates a new Docker Compose deployment if needed.
- (Re-)Starts the containers.
You can specify options like:
--name: Custom name for the LocalNet instance.--config-dir: Custom configuration directory for the LocalNet.--dev/--no-dev: Controls whether to launch ‘algod’ in developer mode or not.
On the first run, the following images will be downloaded:
Once the LocalNet has started, the following endpoints will be available:
- algod:
- address: http://localhost:4001
- token:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- kmd:
- address: http://localhost:4002
- token:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- indexer:
- address: http://localhost:8980
- tealdbg port:
- address: http://localhost:9392
Creating / Starting a Named LocalNet
For control over configuration changes, use named LocalNet instances with algokit localnet start --name {name}. This will run a named LocalNet environment based on the default, but it won’t update automatically.
Specifying a Custom Configuration Directory
Multiple LocalNet instances with different configurations can be managed using --config-dir or by setting the ALGOKIT_LOCALNET_CONFIG_DIR environment variable. For example:
algokit localnet start --config-dir /path/to/custom/config
Controlling Algod Developer Mode
Use --dev or --no-dev to control the startup of algod in developer mode:
algokit localnet start --no-dev # Starts without developer mode
algokit localnet start --dev # Starts with developer mode (default)
Stopping and Resetting the LocalNet
Execute algokit localnet stop to stop the LocalNet without losing the current state. Use algokit localnet reset to refresh the container definition and update to the latest Docker images.
Viewing Transactions in the LocalNet
Use the AlgoKit Explore feature to check the current state of your LocalNet, including transactions.
Executing Goal Commands Against AlgoKit LocalNet
Refer to the AlgoKit Goal feature for executing goal commands. Use algokit localnet console for a Bash shell to run goal commands.
Getting Access to the Private Key of the Faucet Account
To access the private key for transferring ALGOs, use:
- Option 1: Manually via goal
algokit goal account list
algokit goal account export -a {address}
- Option 2: Automatically via kmd API
Utilize the methods in AlgoKit Utils to retrieve the private key automatically.
GitHub Codespaces-based LocalNet
The AlgoKit LocalNet feature also supports running in GitHub Codespaces, allowing you to bypass Docker usage. Use the algokit localnet codespace command for this.
Options
-m,--machine: Specifies the machine type for the Codespace.-a,--algod-port: Sets the Algorand daemon port.-i,--indexer-port: Sets the indexer port.-k,--kmd-port: Sets the kmd port.-n,--codespace-name: Names the codespace.-t,--timeout: Max duration for running the port forwarding process.-r,--repo-url: The repository URL to use.--force,-f: Force deletes stale Codespaces.