Skip to main content
SUBMIT A PRSUBMIT AN ISSUElast edit: Nov 13, 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

Ensure that git is installed on your machine. Refer to the GitHub documentation for installation instructions.

Step 2: Install Docker

Follow Docker's official installation guides and install Docker.

Run Docker first

Before proceeding, make sure that Docker is running.

Step 3: Clone the subtensor repo

Clone the subtensor repository:

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

Step 4: Go into subtensor directory

Navigate into the Subtensor directory:

cd subtensor

Step 5: Switch to main branch

Execute the below commands in this order:

Switch to the main branch:

git checkout main

Pull the latest main branch contents:

git pull

Step 6: Stop and clean Docker environment

Stop any currently running Docker containers and clean up the Docker environment:

docker compose down --volumes && docker system prune -a --volumes -f

Linux post-installation steps for Docker Engine

Please follow Docker's official documentation to perform standard Linux post-installation steps for Docker Engine

tip

Adding a user to the docker group is only necessary on Linux, where sudo privileges are required to run Docker commands. It is unnecessary on macOS.

Run a Lite Node on Mainchain

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

./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, execute the below command.

./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, execute the below command.

./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, execute the below command.

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