Skip to main content
SUBMIT A PRSUBMIT AN ISSUElast edit: May 17, 2024

Using Docker

To run a subtensor node with Docker, follow the below steps.

Not tested on cloud

We have not tested subtensor node installation scripts on any cloud service. In addition, if you are using Runpod cloud service, then note that this service is already containerized. Hence, the only option available to you for Runpod is to install a subtensor node by compiling from source. Note that we have not tested any subtensor installation steps on Runpod.

If you are already running a subtensor node using Docker, then go directly to Step 5 Prepare to Run . The below steps 1 through 4 are for first time users only.

Step 1: Install git

Make sure you installed git on your machine. See GitHub docs.

Step 2: Install Docker

Follow Docker's official installation guides and install Docker.

Run Docker first

Before you proceed, make sure that Docker is running.

Step 3: Clone the subtensor repo

Clone the subtensor repo:

git clone https://github.com/opentensor/subtensor.git

Step 4: Go into subtensor directory

Then cd into the subtensor directory:

cd subtensor

Step 5: Prepare to run

Execute the below three commands in this order:

Make sure you are on the main branch. If not, switch to it:

git checkout main

Pull the latest main branch contents:

git pull

Stop the currently running Docker containers:

docker compose down --volumes

Run a lite node on mainchain

To run a lite node connected to the Bittensor mainchain, run the below command.

sudo ./scripts/run/subtensor.sh -e docker --network mainnet --node-type lite

Run an archive node on mainchain

To run an archive node connected to the Bittensor mainchain, run the below command.

sudo ./scripts/run/subtensor.sh -e docker --network mainnet --node-type archive

Run a lite node on testchain

To run a lite node connected to the Bittensor testchain, run the below command.

sudo ./scripts/run/subtensor.sh -e docker --network testnet --node-type lite

Run an archive node on testchain

To run an archive node connected to the Bittensor testchain, run the below command.

sudo ./scripts/run/subtensor.sh -e docker --network testnet --node-type archive