Raspberry Pi Setup Guide

Use Raspberry Pi Imager to install a 64-bit Raspberry Pi OS on a microSD card, with your hostname, user account, Wi-Fi, and SSH already configured. When you finish, you can SSH into the Pi and install viam-server.

We recommend using Viam on a 64-bit Linux distribution.

If your Pi already runs a 64-bit Linux distribution and you can SSH into it, skip ahead to install viam-server.

Click to check whether the Linux installation on your Raspberry Pi is 64-bit or 32-bit

SSH into your Pi and run lscpu.

Example output:

Screenshot of a terminal running the 'lscpu' command. The output lists of this command on a Raspberry Pi. A red box highlights the command and the top of the output which reads 'Architecture: aarch64.'

If the value of Architecture is aarch64 or otherwise ends in 64, your installation is 64-bit and you can skip ahead to install viam-server.

Hardware requirements

Install Raspberry Pi OS

The Raspberry Pi boots from a microSD card. Raspberry Pi Imager walks you through a series of setup steps, listed in the left sidebar: Device, OS, Storage, Customisation, Writing, and Done.

  1. Connect the microSD card to your computer.

  2. Download Raspberry Pi Imager and launch it. These steps use Imager 2.0.

  3. On the Device step, select your model of Raspberry Pi, then click NEXT.

    Raspberry Pi Imager on the Device step, titled 'Select your Raspberry Pi device', with Raspberry Pi 4 selected.
  4. On the OS step, choose a 64-bit Raspberry Pi OS, then click NEXT:

    • Raspberry Pi OS (64-bit), the first option in the list, includes the Raspberry Pi desktop. Choose it if you plan to connect a monitor, keyboard, and mouse to your Pi.
    • Raspberry Pi OS Lite (64-bit) has no desktop, so it’s smaller and uses less memory. Choose it if you’ll only access the Pi over SSH, which is common for machines. To find it, select Raspberry Pi OS (other).
    Raspberry Pi Imager on the OS step, titled 'Choose operating system', listing Raspberry Pi OS (64-bit) as recommended, followed by Raspberry Pi OS (32-bit) and Raspberry Pi OS (Legacy, 32-bit).
  5. On the Storage step, select the microSD card you intend to use in your Raspberry Pi, then click NEXT.

    If your microSD card isn’t listed, check that it’s connected to your computer correctly.

  6. On the Customisation steps, configure how you’ll reach your Pi over the network. Click NEXT after each one.

    1. Hostname: Enter the name you’ll use to find your Pi on your network, such as my-pi. Use only letters, numbers, and hyphens. You’ll reach the Pi at <hostname>.local, for example my-pi.local.

      Raspberry Pi Imager on the Customisation: Choose hostname step, with the hostname set to my-pi.
    2. Localisation: Select your nearest capital city. Imager suggests a time zone and keyboard layout from your choice, and sets the Wi-Fi regulatory domain for your country. Check that the suggestions are right.

    3. User: Enter a username and password that you’ll use to log into the Pi. The username must be lowercase and contain only letters, numbers, underscores, and hyphens.

    4. Wi-Fi: Select Secure network and enter your Wi-Fi network name (SSID) and password. If your network doesn’t broadcast its name, select Hidden SSID.

      Your Pi uses this network to connect to Viam, so use one that your Pi will be in range of.

    5. Remote access: Turn on Enable SSH, then choose an authentication mechanism:

      • Use password authentication: log in with the username and password from the User step. This is the simplest option for learning and hobby projects.
      • Use public key authentication: log in with an SSH key pair instead of a password. This is more secure and recommended for production. Add your public key to the list Imager shows. If you don’t have a key, generate one first.
    6. Raspberry Pi Connect: Optional. You don’t need Raspberry Pi Connect to use Viam. Leave it off and click NEXT.

    Write down the hostname, username, and password you set. You need them to SSH into your Pi.

  7. On the Writing step, check that the device, operating system, and storage are correct, then click WRITE. Imager warns that all data on the microSD card will be erased. Click I UNDERSTAND, ERASE AND WRITE to continue.

    Your computer’s operating system may ask for an administrator password to allow Imager to write to the card.

    Imager writes the image to the microSD card and then verifies it. This takes several minutes.

  8. When Imager shows Write complete!, check that Customisations applied lists your hostname, user account, Wi-Fi, and SSH. Imager ejects the microSD card automatically. Remove it from your computer and click FINISH.

    Raspberry Pi Imager on the Done step, titled 'Write complete!', listing customisations applied: hostname, localisation, user account, Wi-Fi, and SSH enabled.

Boot your Pi

  1. Insert the microSD card into your Raspberry Pi.
  2. Connect the Pi to power. A power LED lights up.

The first boot applies your customization settings and can take a few minutes, during which the Pi may restart.

Connect to your Pi

From a computer on the same network as your Pi, open a terminal and SSH into the Pi with the username and hostname you set in Imager:

ssh <username>@<hostname>.local

For example, ssh robota@my-pi.local. The first time you connect, type yes to trust the Pi’s host key, then enter your password if you chose password authentication.

Can't connect?
  • Wait a few minutes and try again. The first boot takes longer than later boots.
  • Check that your computer is on the same network as the Pi. <hostname>.local only resolves on the local network.
  • Find the Pi’s IP address and connect to that instead. Look in your router’s list of connected devices for your hostname, then run ssh <username>@<ip-address>.
  • Check your Wi-Fi settings. If the Pi doesn’t appear on your network, the SSID or password may be wrong, or the network may be out of range or 5 GHz-only on a Pi that only supports 2.4 GHz. Re-flash the microSD card with Imager and check the Wi-Fi step.
  • Host key verification failed: If you re-flashed the card with the same hostname, your computer remembers the old host key. Run ssh-keygen -R <hostname>.local and try again.

When you see a prompt like robota@my-pi:~ $, your Pi is set up and online. Keep this SSH session open.

Install viam-server

Next, install viam-server on your Pi from the setup wizard in the Viam app. Run the commands the setup wizard gives you in your SSH session on the Pi.

  • If you came here from the setup wizard, go back to it and continue to the next step.
  • Otherwise, in the Viam app, create a machine, then click Install in the Set up your machine banner to open the setup wizard.

For the full walkthrough, see Set up your first machine: