Primary Network Node Setup with Docker

Configure your node settings, preview the chain config, and run Docker to start your Primary Network node.

  1. 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.json
    Configure your node to see the chain config

    Storage Requirements

    Mainnet · estimate
    Initial
    350GB
    Growth
    +100GB/mo
    After 1 yr
    1.6TB
    21.7TB0
    Now6mo1yr
    Your config
    Archival (21.7TB)
    Pruning ONState SyncTX Index
  2. Set up Instance

    Provision a server with these specs.

    CPU4-8+ cores
    RAM16-32 GB
    Storage1 TB+ NVMe

    Use 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

  3. 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-world

    Not using Docker? Follow the manual installation instructions.

  4. Create Configuration Files

    Run these to write the config files. AvalancheGo reads them from these default paths on startup.

    1. Create config directories

      mkdir -p ~/.avalanchego/configs/chains/C
    2. Node config ~/.avalanchego/configs/node.json

      cat > ~/.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}EOF
    3. C-Chain config ~/.avalanchego/configs/chains/C...

      # Error generating chain config

    DocsNode configC-Chain config

  5. Configure Firewall

    Open the ports your node needs to talk to the network.

    9651Required
    P2P / Staking portNode-to-node communication
    9650RPC only
    HTTP / 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 status

    Validators only need the P2P port. The RPC port stays bound to localhost.

  6. 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.1

    To apply a config change, run docker restart avago. The node reads its config files when it starts.

  7. 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 avago

  8. Backup Validator Credentials

    Your validator identity is defined by these files in ~/.avalanchego/staking/

    TLS Cert
    staker.crtNode identity
    Private KeySecret
    staker.keyKeep secret
    BLS KeySecret
    signer.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.