By default the Raspberry Pi only contains an ARM based CPU, memory (RAM), and connection interfaces like GPIO, USB, etc.
- Raspberry Pi Imager
- Download for your computer's OS.
- Raspberry Pi 4 Model B 8 GB
- CanaKit Raspberry Pi 4 Extreme Kit - Aluminum Edition (8GB RAM) - We recommend this kit to get started easier with all the necessary cables, power supplies, etc. However, you can buy the Raspberry Pi alone if you wish.
Keep in mind if you choose not to buy a kit including a microSD card, you will need to purchase one similar to this on on Amazon for the OS.
-
Insert the microSD card into your computer with Raspberry Pi Imager installed. You may need to format the microSD card to allow it to be seen by Raspberry Pi Imager. You can format it to exFAT on any OS and it will be seen by the imager.
-
Open Raspberry Pi Imager. The following window should appear:
- Click
CHOOSE OS. You can choose one of the following operating systems. Note that some of these do not have graphical user interfaces (GUIs). Since the Raspberry Pi is resource constrained it is recommended to use the Pi without a GUI if possible. However if you require a GUI, we recommend installing a light-weight one like LightDM + XFCE4 (see Installing a GUI for details).
Raspberry Pi OS (other)>Rasberry Pi OS (64-bit)Raspberry Pi OS (other)>Rasberry Pi OS Lite (64-bit)- Note: No GUI included! See Installing a GUI!
Other general-purpose OS>Ubuntu>Ubuntu Server 20.04.5 LTS (64-bit)- RECOMMENDED, Note: No GUI included! See Installing a GUI!
Now your window should look like:
- Now, click
CHOOSE STORAGEand select the microSD card you selected.
WARNING: Ensure you selected the correct device! The next step will permanently ERASE the device you selected!
- Click
WRITEand wait for the microSD card to be flashed.
-
While the Raspberry Pi is powered off, insert the microSD card into the Raspberry Pi's microSD card slot.
-
Connect a mouse and keyboard to the Raspberry Pi's USB port(s).
-
Connect the Raspberry Pi to a monitor.
-
Connect an ethernet cable to the Raspberry Pi for internet (if available). Note: You may need to contact your IT admin to get wired network access.
-
Power on the Raspberry Pi.
-
Depending on the OS you installed you will need to either setup your login credentials or use the default configured credentials.
For Ubuntu Server installs the default credentials are:
- Username:
ubuntu - Password:
ubuntu
For Raspberry Pi OS:
- Username:
pi - Password:
raspberry
If these don't work, then you can simply search for default raspberry pi login and you should get a list of options to try.
- Change the default user's password (if not automatically prompted).
passwd default_username # change the password for a username- Lock the root account to disable login with root:
sudo passwd root --lock- Create a new user with sudo access:
sudo useradd -m new_username
sudo usermod -aG sudo new_username- Logout of the default user using the
exitcommand and then login with the new user you created and change the default shell to bash:
chsh -s /bin/bash- Delete the default user and its home directory:
sudo userdel /home/default_username
sudo rm -rf /home/default_username- Connect the Raspberry Pi to the internet using an ethernet cable if you haven't already and update the system with:
sudo apt update
sudo apt upgrade -y
sudo apt autoremove --purge- Reboot the Raspberry Pi using
sudo reboot.
To run ML applications on the Raspberry Pi you have two choices:
- Run the ML application on the CPU
- Run the ML model on a connected edge accelerator
Refer to the specific edge accelerator's documentation for details on setup info for the Raspberry Pi.
NOTE: Setup may be different for the Raspberry Pi since it has an ARM based CPU!
COMING SOON
For Ubuntu Server/Raspberry Pi OS Lite - OPTIONAL
There are many display managers (DMs) and desktop environments (DEs) available for Linux. Display managers simply display the GUI. Desktop environments are the GUI interface you use in Linux. Both are required to install and use a GUI. We will use light-weight options for the Raspberry Pi since it is resource constrained: LightDM for the DM and XFCE4 for the DE.
To install LightDM and XFCE4 for your Raspberry Pi, run the following commands:
sudo apt update# Updates APT package repossudo apt upgrade# Upgrades all of the softwaresudo apt install lightdm# Install and Configure LightDM as default if asked.sudo dpkg-reconfigure lightdm# Select lightdmsudo apt install xfce4 xfce4-goodies# Install XFCE4 GUI- Reboot your machine and the GUI should show up asking for login credentials. Be sure to look for a button to select
XFCE Sessionto select XFCE as your DE.
NOTE: Installing a firewall is recommended to prevent unauthorized parties from accessing the Pi as well as lock down ports for incoming traffic. However, keep in mind this will affect services like SSH.
- Install the Uncomplicated FireWall (UFW) via apt:
sudo apt install ufw- Enable the ufw service at startup and start the service.
sudo systemctl enable ufw
sudo systemctl start ufw
sudo ufw enable
sudo ufw default deny- Allow any services, like SSH, through the firewall. For example:
sudo ufw allow 22 # 22 is the default port for SSH
# OR
sudo ufw allow ssh # This is an alternative way of allowing SSH
