Using Docker
Learn how to run an Avalanche node using Docker.
Prerequisites
Before beginning, you must ensure that:
- Docker is installed on your system
- You need to clone the AvalancheGo repository
- You need to install GCC and Go
- Docker daemon is running on your machine
You can verify your Docker installation by running:
Building the Docker Image
To build the Docker image for the latest avalanchego branch:
- Navigate to the project directory
- Execute the build script:
This script will create a Docker image containing the latest version of AvalancheGo.
Verifying the Build
After the build completes, verify the image was created successfully:
You should see an image with:
- Repository:
avaplatform/avalanchego - Tag:
xxxxxxxx(wherexxxxxxxxis the shortened commit hash of the source code used for the build)
Running AvalancheGo Node
To start an AvalancheGo node, run the following command:
This command:
- Creates an interactive container (
-ti) - Maps the following ports:
9650: HTTP API port9651: P2P networking port
- Uses the built AvalancheGo image
- Executes the AvalancheGo binary inside the container
Port Configuration
The default ports used by AvalancheGo are:
9650: HTTP API9651: P2P networking
Ensure these ports are available on your host machine and not blocked by firewalls.
Is this guide helpful?