Raspberry Pi supports several Linux distributions. Most of the time you just need to flash the system image to an SD card, insert that SD card into your Raspberry Pi and start running it. However, this doesn’t apply for Ubuntu. Installing Ubuntu on Raspberry Pi used to be a chore, with the need to create an Ubuntu SSO account first before downloading the Ubuntu Core image.
Luckily, with the release of the Raspberry Pi Imager tool, installing Ubuntu on Raspberry Pi is now very easy. You’ll learn in this article how to flash an Ubuntu image to your Raspberry Pi.
Introducing the Raspberry Pi Imager
In March 2020, the official Raspberry Pi Foundation released the Raspberry Pi Imager tool. This is a straightforward tool that downloads a list of the various operating systems that you can use with your Raspberry Pi.
Simply select an image from the list, and the Raspberry Pi Imager will read the relevant files from the Foundation’s website and write them directly to your SD card, without you having to worry about sourcing the correct system image and downloading it to your hard drive.
Let’s look at how you can use this tool to install Ubuntu on your Raspberry Pi.
Install Ubuntu using the Raspberry Pi Imager
If you haven’t already, head over to the Raspberry Pi Foundation’s website and download the correct version of Raspberry Pi Imager for your operating system.
Once the Raspberry Pi Imager is installed:
1. Insert your SD card into your laptop or computer.
2. Launch the Raspberry Pi Imager application.
3. Click “Choose OS.” The Imager will now retrieve and display information about the various operating systems that are compatible with Raspberry Pi.
4. Since you want to install Ubuntu, select “Ubuntu.”
You can now choose from the latest LTS (Long Term Support) Ubuntu server images or the Ubuntu Core images. At the time of writing, the following images were available for Raspberry Pi:
- Ubuntu 20.04 LTS. 32-bit server OS for armhf architectures.
- Ubuntu 20.04 LTS. 64-bit server OS for arm64 architectures.
- Ubuntu Core 18. Ubuntu Core 18 32-bit IoT OS for armhf architectures.
- Ubuntu Core 18. Ubuntu Core 18 64-bit IoT OS for arm64 architectures.
Make sure you select an image that’s compatible with your specific model of Raspberry Pi.
5. Once you’ve made your choice, click “Choose SD card” and select the SD card where you want to write your system image.
6. Now, the only thing left to do is click “Write” and wait for the Raspberry Pi Imager to write the system image to your SD card.
Configure Ubuntu to Connect to Wi-Fi Automatically
Next, edit the Ubuntu system image on the SD card so that the Pi connects to the Wi-Fi network automatically:
1. Make sure your SD card is inserted into your laptop or computer. Launch a file-manager application and go to the SD card folder.
2. Open the “system-boot” partition, as this contains the configuration files that’ll be loaded when the Raspberry Pi boots.
3. Open the “network-config” file in a text editor.
4. Find the “wifis” section and uncomment everything inside this section by removing the “#” at the beginning of each line.
The Wi-Fi section should now look similar to the image below.
You’ll need to update “access-points” to reference the name of your Wi-Fi network. If this name contains any spaces, make sure you surround it with quotation marks, for example:
Next, replace “S3kr1t” with the password for your own Wi-Fi network.
Save this file and safely eject the SD card from your laptop or computer.
Now, every time you boot your Raspberry Pi, it’ll connect to the network automatically.
Using Ubuntu on Raspberry Pi
Connect your monitor and keyboard to the Raspberry Pi and power it up. On the login scren, log into Ubuntu’s default account: “ubuntu” for both the username and password.
Since this default login is public knowledge, you’ll be prompted to change the password to something more secure. To create a new password, follow the onscreen instructions.
Consider installing a desktop
By now, you’ll have noticed that Ubuntu doesn’t come with a Graphical User Interface (GUI), so you can only interact with your Raspberry Pi from the command line.
If you’d prefer to interact with your Pi in a desktop environment, then there are plenty of desktops you can install:
Firstly, update your Raspberry Pi:
You can then install your preferred desktop environment. For example:
Once you’ve installed your desktop environment, reboot your Pi with the following command:
When your Raspberry Pi boots, the desktop environment will be ready for you to use.
Setup a headless Raspberry Pi
If you prefer to run your Pi headless, then you may want to communicate with it over SSH.
To communicate over SSH, you’ll need to know your Raspberry Pi’s IP address. If you don’t know your Pi’s IP address, there are several ways you can retrieve this information for a headless Raspberry Pi:
- You can view information about all the devices that are connected to your network by logging into your router’s configuration page. In your web browser’s address bar, enter your router’s IP address and then log in to your account.
Every router is different, but if you explore the various menus and sections, you should be able to find a record of all the devices connected to your router. Find your Raspberry Pi in the list, give it a click, and you should have access to the Pi’s IP address.
- Fing for Android and iOS
Install this app on your smartphone, then select “Scan for devices -> Devices.” You should now have a list of devices that are currently connected to your network.
Find your Raspberry Pi and make a note of its IP address.
Connecting over SSH
Once you have your Raspberry Pi’s IP address, you’re ready to connect over SSH.
On your computer, open a Terminal and run the following command:
When prompted, enter Ubuntu’s default password: “ubuntu.”
You’re now connected to your Raspberry Pi and can start issuing commands over SSH.
As you can see, it is easy to install Ubuntu on your Raspberry Pi using the new Imager application. If you are not interested in Ubuntu, you can also install FydeOS on Raspberry Pi or just turn your Raspberry Pi into a Wi-Fi bridge.