.fw files. A .fw file is a ZIP archive that holds the firmware’s metadata, its data, and an Ed25519 signature. NervesHub checks the signature when you upload, and the device checks it again before it installs. See Firmware signing for how the keys fit together.
A product accepts fwup firmware by default. RAUC, ESP-IDF and AtomVM each have their own page.
Before you start
- A product whose name matches your firmware’s product name. NervesHub refuses firmware built for a different product.
- The
nhCLI, signed in, with your organization and product set. See CLI configuration. fwupinstalled on the machine that uploads.nhuses it to sign.fwfiles.
Build firmware
.fw file is written under _build/${MIX_TARGET}_${MIX_ENV}/nerves/images/.
The firmware’s version must be a valid SemVer version, such as 1.4.0. NervesHub 2.5.0 and later reject uploads with any other version.
Create a signing key
Signing keys belong to your organization, not to one product. Create one if you have none:~/.nh/keys/<org>/ as my_app_key.priv and my_app_key.pub. The private key is encrypted at rest. --password sets its passphrase. The passphrase is optional, and nh prompts for one when it runs interactively.
You can also see and add keys in the web UI under the organization’s settings, on the Signing keys page.
To register a public key you generated elsewhere, for example with fwup -g, use nh key add <name> --public-key <file>.
Upload firmware
nh then looks for a single image under _build/<MIX_TARGET>_<MIX_ENV>/nerves/images/ and asks you to confirm it.
nh reads the firmware’s metadata, shows it, signs a temporary copy with fwup, and uploads that copy. Your original file is not modified. On success it prints the firmware’s version and UUID.
The signing key comes from one of:
If the file is already signed with a key your organization has registered, upload it as is:
What NervesHub checks
NervesHub refuses an upload when:- Your organization has no signing keys.
- The signature matches none of your organization’s keys.
- The firmware’s product name is not the product you uploaded to.
- The version is not valid SemVer.
- Firmware with the same UUID is already in the product. The UUID comes from the firmware’s contents, so this means the same build was uploaded before.
- The product has Require unique firmware versions on and already holds firmware with this version for the same platform and architecture. The upload fails with “has already been taken for this product”. Raise the version in
mix.exsand build again. The setting is on for products created on NervesHub 2.5.0 or later. Change it in Product settings, in the Firmware card on the General tab, or withnh product update <product> --require-unique-firmware-version=false. - The firmware needs a newer
fwupthan the NervesHub server has.
Deploy in the same command
--deploy creates a release with the new firmware on a deployment group after the upload succeeds. It does not turn the group on. Repeat it to update several groups:
--deploy is not given, nh uses the NERVES_HUB_DEPLOYMENT_NAME environment variable when it is set. If the upload succeeds and a deployment update fails, the firmware stays uploaded and the error says which group failed.
List, inspect, download, and delete
download saves the image in the current directory as <uuid> with the extension for its format, which is .fw for fwup firmware. Pass --file <path> to choose the path.
NervesHub refuses to delete firmware that is the current release of a deployment group, or that devices are in the middle of installing. Deleting firmware also deletes the deltas built from it.
Upload from CI
In a pipeline, givenh its settings through the environment and pass the firmware path:
nh looks for the image itself and asks you to confirm it, which fails without a terminal. Store the token and the private key as protected secrets in your CI system.
NERVES_HUB_PRIVATE_KEY needs an unencrypted fwup key, as fwup -g writes. A key made with nh key create is encrypted and does not work there. See Sign in CI.
See CI/CD for access tokens, product API keys, and the GitHub Action.

