Primary Network Node Setup with Docker
Configure your node settings, preview the chain config, and run Docker to start your Primary Network node.
Configure Node Settings
Choose your network, node type, and settings. The config preview updates as you go.
Network
Node type
Log level · info is the default
Storage
Cuts disk usage by ~44x (13TB → 300GB) by removing old state data. Recommended for validators.
Bootstraps from a state summary instead of replaying every block. Recommended for validators to speed up initial sync.
Configuration Preview
C-Chain config.jsonConfigure your node to see the chain configStorage Requirements
Mainnet · estimate- Initial
- 350GB
- Growth
- +100GB/mo
- After 1 yr
- 1.6TB
21.7TB0Now6mo1yrYour configArchival (21.7TB)Pruning ONState SyncTX IndexSet up Instance
Provision a server with these specs.
CPU4-8+ coresRAM16-32 GBStorage1 TB+ NVMeUse local NVMe, not cloud block storage (EBS, Persistent Disk). With the validator settings, storage starts at about 300 GB and grows about 80 GB a month. System requirements
Docker Installation
Make sure you have Docker installed on your system. You can use the following commands to install it:
# Install Docker using convenience scriptcurl -fsSL https://get.docker.com -o get-docker.shsudo sh get-docker.shsudo usermod -aG docker $USERnewgrp docker# Test installationdocker run -it --rm hello-worldNot using Docker? Follow the manual installation instructions.
Create Configuration Files
Run these to write the config files. AvalancheGo reads them from these default paths on startup.
Create config directories
mkdir -p ~/.avalanchego/configs/chains/CNode config
~/.avalanchego/configs/node.jsoncat > ~/.avalanchego/configs/node.json << 'EOF'{ "network-id": "mainnet", "public-ip-resolution-service": "opendns", "http-host": "0.0.0.0", "http-port": 9650, "staking-port": 9651}EOFC-Chain config
~/.avalanchego/configs/chains/C...# Error generating chain config
Configure Firewall
Open the ports your node needs to talk to the network.
9651RequiredP2P / Staking portNode-to-node communication9650RPC onlyHTTP / RPC portAPI requests from clients# Open SSH and P2P ports (validators don't expose RPC)sudo ufw allow OpenSSHsudo ufw allow 9651/tcp comment 'AvalancheGo P2P'sudo ufw --force enablesudo ufw statusValidators only need the P2P port. The RPC port stays bound to localhost.
Run Docker
Start the node. The command gives the node the path of its config file. The node reads all other settings from the mounted volume.
docker run -it -d \ --name avago \ -p 127.0.0.1:9650:9650 -p 9651:9651 \ -v ~/.avalanchego:/root/.avalanchego \ -e AVAGO_CONFIG_FILE=/root/.avalanchego/configs/node.json \ avaplatform/avalanchego:v1.15.1To apply a config change, run
docker restart avago. The node reads its config files when it starts.Wait for the Node to Bootstrap
Your node now bootstraps and syncs the Primary Network (P-Chain, X-Chain, and C-Chain). This can take several hours to days depending on your hardware and connection.
Follow progress in the logs:
docker logs -f avagoBackup Validator Credentials
Your validator identity is defined by these files in
~/.avalanchego/staking/TLS Certstaker.crtNode identityPrivate KeySecretstaker.keyKeep secretBLS KeySecretsigner.keyP-Chain signing# Back up your validator credentials# The node runs as root in Docker, so the key files belong to rootmkdir -p ~/avalanche-backupsudo cp -r ~/.avalanchego/staking ~/avalanche-backup/sudo chown -R "$(id -u):$(id -g)" ~/avalanche-backup# Verify backupls -la ~/avalanche-backup/staking/Store securelyEncrypted USBEncrypted S3Multiple locations- Lost keys mean missed staking rewards (the validator can't sign). NVMe drives can fail without warning.
- Never share private keys: anyone with them can impersonate your validator.