# `mix upload`
[🔗](https://github.com/nerves-project/ssh_subsystem_fwup/blob/v0.6.7/lib/mix/tasks/upload.ex#L8)

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. Another option is to use the `--password` flag which
requires `sshpass` to be installed.

## Command line options

 * `--firmware` - The path to a fw file
 * `--password` - A password to use for SSH authentication
 * `--port` - An alternative TCP port to use for the upload (defaults to 22)

## 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*
