# Run a local subtensor chain

Run a local Bittensor subtensor chain for development, from Docker or from source.

_Source: https://beta.taostats.io/docs/concepts/chain-runtime/deploy-a-dtao-chain_

_Last reviewed: 2026-10-05_

Run a local Bittensor subtensor chain for development, from Docker or from source.

The subtensor code is on GitHub: [https://github.com/RaoFoundation/subtensor](https://github.com/RaoFoundation/subtensor). The local chain runs the same runtime as mainnet, including dTAO subnets, on fast blocks.

## Option 1: Docker (quickest)

```shell
docker run --rm --name local_chain \
  -p 9944:9944 -p 9945:9945 \
  ghcr.io/raofoundation/subtensor-localnet:devnet
```

Image tags:

| Tag | Contents |
|---|---|
| `:devnet` | The commit deployed to devnet |
| `:testnet` | The commit deployed to testnet |
| `:main` (alias `:latest`) | The current main-branch candidate |
| `:sha-<commit>` | A fixed commit, for reproducible CI |

## Option 2: Build from source

```shell
git clone https://github.com/RaoFoundation/subtensor.git
cd subtensor
./scripts/init.sh        # installs the Rust toolchain and wasm target
./scripts/localnet.sh    # builds the node and launches a fast-blocks localnet
```

The repository pins its Rust toolchain in `rust-toolchain.toml`, so `init.sh` installs the right version. You don't need nightly Rust.

`localnet.sh` builds with the `pow-faucet` feature, so local wallets can request test TAO from the faucet. Pass `False` as the first argument (`./scripts/localnet.sh False`) to run at normal 12-second block times instead of fast blocks.

## Connect to your local chain

The local node serves RPC on `ws://127.0.0.1:9944`.

```shell
btcli --network local query is-fast-blocks
```

From Python:

```python
import bittensor
client = bittensor.Client("local")
```

Install the SDK from [https://github.com/RaoFoundation/bittensor](https://github.com/RaoFoundation/bittensor) (`pip install bittensor`). For building from source, the Alice dev account, and faucet behaviour, see the upstream [local development guide](https://bittensor.com/docs/guides/local-development).
