You are browsing documentation for a version other than the latest stable release. Switch to the latest stable release, 2.3.

Prepare a Raspberry Pi device

If you do not have have a Raspberry Pi, please go to Prepare a virtual device.

In this tutorial we will prepare a Raspberry Pi with a custom Raspberry Pi OS (previously called Raspbian) image. The only difference from the official Raspberry Pi OS image is that it has been converted to support robust system updates with Mender.

Completing this tutorial normally takes less than one hour.

Prerequisites

To follow this tutorial, you will need the following:

Step 1 - Flash the Raspberry Pi

Download the Raspberry Pi OS image with Mender integrated:

Follow the steps outlined in the Raspberry Pi OS documentation to flash the OS image to the device.

We recommended to use the Raspberry Pi Imager tool, choose "Use custom" and browse to the downloaded Mender Raspberry Pi OS image.

Writing the SD card takes 5-25 minutes, mainly depending on your SD card and writer speed.

connecting a device

Step 2 - SSH into the Raspberry Pi

Boot the Raspberry Pi with the newly flashed SD card and Enable local SSH access.

If you do not know the IP address of your Raspberry Pi device, there are some great resources in the Raspberry Pi OS documentation on different ways of looking this up.

SSH into your device:

ssh pi@<DEVICE-IP-ADDRESS>

The default password for the pi account is raspberry.

You should now see a command prompt similar to the following:

pi@raspberrypi:~ $

Keep this terminal open as we will shortly use it to install the Mender client.

Step 3 - Login to hosted Mender

Login to hosted Mender. On the main page for the first time new users will get a tutorial in the Mender web GUI.

Go to the Dashboard tab and click on Connect a device.

connecting a device

Step 4 - Connect a device

Select PREPARE AND CONNECT MY RASPBERRY PI.

connecting a device

Step 5 - Choose device type

You need to specify one of the following:

  • Raspberry Pi 3
  • Raspberry Pi 4

connecting a device

Step 6 - Install the Mender client on the device

Next we will install the Mender client on the device and connect it to the Mender server.

accepting the device

In the dialog box from above, click Copy to clipboard to copy the code to install the Mender client. Now go to the command line on your device, and paste the code e.g. by right-clicking in the terminal and selecting Paste, followed by Enter.

This downloads the Mender client on the device, configures and starts it.

Step 7 - Accept the device

Once the client has started, the Mender client will attempt to connect to the server and it will appear in your Pending devices tab in the server. Go ahead and Accept the pending device in the server. After accepting the device, it will appear on the Device groups tab on the left of Pending.

connecting a device

Next step

Proceed to Deploy an application update.