Upgrade Your AvalancheGo Node

Upgrade an AvalancheGo node to a new release before a network upgrade activates.

Note

Get an email when a new AvalancheGo release is out

Never miss a mandatory AvalancheGo upgrade again. Set up Validator Alerts on Builders Hub to receive email notifications when new versions are released, when your uptime drops, or when your stake is about to expire.

Backup Your Node

Before upgrading your node, it is recommended you backup your staker files which are used to identify your node on the network. In the default installation, you can copy them by running following commands:

cd
cp ~/.avalanchego/staking/staker.crt .
cp ~/.avalanchego/staking/staker.key .
cp ~/.avalanchego/staking/signer.key .

Then download the staker.crt, staker.key and signer.key files. Keep them in a safe and private location. If your node or its machine fails, use these three files to recreate your node with the same NodeID and BLS key.

Node Installed Using the Installer Script

If you installed your node using the installer script, to upgrade your node, just run the installer script again.

./avalanchego-installer.sh

It will detect that you already have AvalancheGo installed:

AvalancheGo installer
---------------------
Preparing environment...
Found 64bit Intel/AMD architecture...
Found AvalancheGo systemd service already installed, switching to upgrade mode.
Stopping service...

It will then upgrade your node to the latest version, and after it's done, start the node back up, and print out the information about the latest version:

Node upgraded, starting service...
New node version:
avalanchego/1.15.1 [database=v1.4.5, rpcchainvm=46, commit=fdb2c1b9b02ef357b5867d5ababb6acc83837a01, go=1.26.8]
Done!

Your node now runs the latest version. The installer does not update VM plugins. If your node runs L1 VM plugins (for example Subnet-EVM), update each plugin in ~/.avalanchego/plugins to a build with the same plugin version as the new node. A chain whose plugin has a different plugin version does not start. Since v1.14.2, each AvalancheGo release includes Subnet-EVM binaries in its assets.

If you installed your node manually, proceed with the rest of the tutorial.

Stop the Old Node Version

After the backup is secured, you may start upgrading your node. Begin by stopping the currently running version.

Node Running from Terminal

If your node is running in a terminal stop it by pressing ctrl+c.

Node Running as a Service

If your node is running as a service, stop it by entering: sudo systemctl stop avalanchego.service

(your service may be named differently, avalanche.service, or similar)

Node Running in Background

If your node is running in the background (by running with nohup, for example) then find the process running the node by running ps aux | grep avalanche. This will produce output like:

ubuntu  6834  0.0  0.0   2828   676 pts/1    S+   19:54   0:00 grep avalanche
ubuntu  2630 26.1  9.4 2459236 753316 ?      Sl   Dec02 1220:52 /home/ubuntu/build/avalanchego

In this example, second line shows information about your node. Note the process id, in this case, 2630. Stop the node by running kill -2 2630.

Now we are ready to download the new version of the node. You can either download the source code and then build the binary program, or you can download the pre-built binary. You don't need to do both.

Downloading pre-built binary is easier and recommended if you're just looking to run your own node and stake on it.

Building the node from source is recommended if you're a developer looking to experiment and build on Avalanche.

Download Pre-Built Binary

If you want to download a pre-built binary instead of building it yourself, go to our releases page, and select the release you want (probably the latest one.)

Note

If you have a node, set up Validator Alerts with your NodeID to get an email when a new release comes out.

In addition, or if you don't have a node ID, you can get release notifications from github. To do so, you can go to our repository and look on the top-right corner for the Watch option. After you click on it, select Custom, and then Releases. Press Apply and it is done.

Under Assets, select the appropriate file.

For macOS: Download: avalanchego-macos-<VERSION>.zip Unzip: unzip avalanchego-macos-<VERSION>.zip The command writes the binary to build/avalanchego.

For Linux on PCs or cloud providers: Download: avalanchego-linux-amd64-<VERSION>.tar.gz Unzip: tar -xvf avalanchego-linux-amd64-<VERSION>.tar.gz The resulting folder, avalanchego-<VERSION>, contains the avalanchego binary.

For Linux on Arm64-based computers: Download: avalanchego-linux-arm64-<VERSION>.tar.gz Unzip: tar -xvf avalanchego-linux-arm64-<VERSION>.tar.gz The resulting folder, avalanchego-<VERSION>, contains the avalanchego binary.

<VERSION> is the release tag, for example v1.15.1.

You are now ready to run the new version of the node.

Running the Node from Terminal

If you are using the pre-built binaries on MacOS:

./build/avalanchego

If you are using the pre-built binaries on Linux:

./avalanchego-<VERSION>/avalanchego

Add nohup at the start of the command if you want to run the node in the background.

Running the Node as a Service

If you're running the node as a service, you need to replace the old binaries with the new ones.

cp -r avalanchego-<VERSION>/* <DIRECTORY_WITH_OLD_BINARIES>

and then restart the service with: sudo systemctl start avalanchego.service.

Build from Source

First clone our GitHub repo (you can skip this step if you've done this before):

git clone https://github.com/ava-labs/avalanchego.git

Note

The repository cloning method used is HTTPS, but SSH can be used too:

git clone [email protected]:ava-labs/avalanchego.git

You can find more about SSH and how to use it here.

Then move to the AvalancheGo directory:

cd avalanchego

Pull the latest code:

git pull

Note

The master branch holds unreleased code, which can use a different plugin version than the latest release. To build a release, run git fetch --all --tags and then git checkout --force tags/<tag> instead of git pull. <tag> is the latest release tag, for example v1.15.1.

Note that your local copy will be in a 'detached HEAD' state, which is not an issue if you do not make changes to the source that you want push back to the repository (in which case you should check out to a branch and to the ordinary merges).

Note also that the --force flag will disregard any local changes you might have.

Check that your local code is up to date. Do:

git rev-parse HEAD

and check that the first 7 characters printed match the Latest commit field on our GitHub.

Note

If you used the git checkout tags/<tag> then these first 7 characters should match commit hash of that tag.

Now build the binary:

./scripts/build.sh

The script prints Building AvalancheGo with [<go version>]... and writes the binary to build/avalanchego. It prints no success message. The build needs Go 1.26.8 or later, gcc and g++.

You can check what version you're running by doing:

./build/avalanchego --version

You can run your node with:

./build/avalanchego

Is this guide helpful?