# `mix upload`
[🔗](https://github.com/nerves-project/nerves_firmware_ssh/blob/v0.4.6/lib/mix/tasks/upload.ex#L1)

Upgrade the firmware on a Nerves device using SSH.

By default, `mix upload` reads the firmware built by the current `MIX_ENV`
and `MIX_TARGET` settings, and sends it to `nerves.local`. Pass in a another
hostname to send the firmware elsewhere.

NOTE: This implementation cannot ask for passphrases, and therefore, cannot
connect to devices protected by username/passwords or decrypt
password-protected private keys. One workaround is to use the `ssh-agent` to
pass credentials.

## Command line options

 * `--firmware` - The path to a fw file

## Examples

Upgrade a Raspberry Pi Zero at `nerves.local`:

    MIX_TARGET=rpi0 mix upload nerves.local

Upgrade `192.168.1.120` and explicitly pass the `.fw` file:

    mix upload 192.168.1.120 --firmware _build/rpi0_prod/nerves/images/app.fw

---

*Consult [api-reference.md](api-reference.md) for complete listing*
