Run AvalancheGo with Docker
Learn how to run an Avalanche node using the official AvalancheGo Docker image.
For an easier way to set up and run a node, try the Avalanche Console Node Setup Tool.
Prerequisites
- Docker installed and running
Verify your Docker installation:
docker --versionQuick Start
Pull and run the latest AvalancheGo release:
docker run -d \
--name avalanchego \
-p 9650:9650 \
-p 9651:9651 \
-v ~/.avalanchego:/root/.avalanchego \
avaplatform/avalanchego:v1.14.1This will start an AvalancheGo node and begin syncing with the Avalanche network.
Replace v1.14.1 with the latest release version from the AvalancheGo releases page.
What This Command Does
| Flag | Purpose |
|---|---|
-d | Runs the container in the background (detached mode) |
--name avalanchego | Names the container for easy reference |
-p 9650:9650 | Exposes the HTTP API port |
-p 9651:9651 | Exposes the P2P staking port |
-v ~/.avalanchego:/root/.avalanchego | Persists chain data and node configuration to your host machine |
The volume mount (-v) is important. Without it, chain data is lost when the container is removed and the node will need to re-sync from scratch.
Check Node Status
Once the container is running, check that the node is bootstrapping:
curl -X POST --data '{
"jsonrpc":"2.0",
"id" :1,
"method" :"info.isBootstrapped",
"params": {
"chain": "X"
}
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/infoThe response will show "isBootstrapped": true once the node has finished syncing.
View Logs
docker logs -f avalanchegoStop and Restart
docker stop avalanchego
docker start avalanchegoUpgrade to a New Version
To upgrade AvalancheGo, stop the current container, remove it, and run the new version:
docker stop avalanchego
docker rm avalanchego
docker run -d \
--name avalanchego \
-p 9650:9650 \
-p 9651:9651 \
-v ~/.avalanchego:/root/.avalanchego \
avaplatform/avalanchego:<NEW_VERSION>Your chain data is preserved in ~/.avalanchego on the host, so the node will resume from where it left off.
Pass Configuration Flags
You can pass any AvalancheGo configuration flags directly after the image name:
docker run -d \
--name avalanchego \
-p 9650:9650 \
-p 9651:9651 \
-v ~/.avalanchego:/root/.avalanchego \
avaplatform/avalanchego:v1.14.1 \
--http-host=0.0.0.0 \
--public-ip-resolution-service=opendnsConnect to Fuji Testnet
To run a node on the Fuji testnet instead of Mainnet:
docker run -d \
--name avalanchego-fuji \
-p 9650:9650 \
-p 9651:9651 \
-v ~/.avalanchego-fuji:/root/.avalanchego \
avaplatform/avalanchego:v1.14.1 \
--network-id=fujiPort Reference
| Port | Protocol | Purpose |
|---|---|---|
9650 | TCP | HTTP API (RPC calls) |
9651 | TCP | P2P networking and staking |
Ensure these ports are open in your firewall. Port 9651 must be reachable from the internet for your node to participate in the network.
Is this guide helpful?