Remotely update your devices

Connect can update your Raspberry Pi devices by pushing updates to them remotely. Remote updates are useful for devices that are behind a firewall, physically remote, or hard to reach.

To update a device remotely:

  1. Opt the device in to remote updates.

  2. Build an update artefact: either a script artefact or an A/B boot update.

  3. Deploy the artefact from the Connect website, then monitor and verify the deployment.

If your devices belong to a Connect for Organisations account, you have more options. An organisation keeps a library of artefacts that you can deploy more than once, and you can host an artefact yourself instead of uploading it, so that the artefact doesn’t expire while you wait for a device to come online. For more information, see Deploy remote updates in an organisation.

Choose an update type

Connect supports two types of update artefact:

Script artefact A/B boot update

What it does

Runs a shell script as root on the device.

Replaces the entire operating system.

Suitable for

Maintenance tasks, such as upgrading packages, changing configuration, or installing software.

Complete, versioned operating system images.

If the update fails

No automatic recovery. Test your scripts carefully before you deploy them.

The device automatically reverts to the previous working version.

Device setup

Works on a standard installation of Raspberry Pi OS.

You must first image the device with an A/B boot layout, which needs physical access to the device.

Supported devices

Any Raspberry Pi that runs Connect.

Raspberry Pi 4 and later.

Build tool

otamaker

rpi-image-gen

Opt a device in to or out of remote updates

A device can only receive remote updates if it’s opted in. In the Connect website, devices that are opted in show a Remote update badge, and a Deploy button in the Devices tab.

The device must be:

  • Connected to the internet.

  • Linked to your Connect account and signed in.

  • Running the latest version of Connect or Connect Lite, with the rpi-connect-ota package installed.

If you’re setting up an A/B boot update, the example image that rpi-image-gen builds opts the device in for you, so you can skip this section.

To opt a device in:

  1. Install or update Connect and the rpi-connect-ota package:

    $ sudo apt update
    $ sudo apt install rpi-connect rpi-connect-ota

    Enter your password if prompted. If you use Connect Lite, install rpi-connect-lite instead of rpi-connect.

  2. Opt in to remote updates using the ota (over-the-air) subcommand:

    $ rpi-connect ota on

    The command needs superuser rights, so enter your password if prompted. It also restarts Connect, which ends any active screen-sharing or remote shell sessions, including a remote shell you run it from.

  3. Refresh the Devices tab in the Connect website. The Deploy button appears next to the device.

    To check from the device, run rpi-connect status. The output includes Remote update: allowed.

To opt a device out of remote updates, run the following command:

$ rpi-connect ota off

Like ota on, this command asks for your password and restarts Connect, ending any active sessions.

Signing out of Connect doesn’t opt a device out. A device stays opted in until you run rpi-connect ota off.