Menu Close

Install an OS on Raspberry Pi

Install an OS on a Raspberry Pi

When you have the right tools, it’s easy to install an OS on a Raspberry Pi. And this guide will help you get all the tools you need. If you are here, you probably already know a bit about the Pi. As such, let’s cut the chatter and get down to business.

This post may contain affiliate links.  If you make a purchase I may get a commission at no cost to you.  Please see the Disclaimer for additional information.

Equipment

Raspberry Pi 2 or Newer (2, 3, 3B+ or 4)
32GB MicroSD card (if you don’t buy a Raspberry Pi kit)
Keyboard (if not using SSH)
Mouse (if not using SSH)
USB Keyboard and mouse combo (if not using SSH)
HDMI Cable (if not using SSH, Raspberry Pi 3B+ and lower)
HDMI Adapter (if not using SSH, Raspberry Pi 3B+ and lower)
Mini HDMI Cable (if not using SSH, Raspberry Pi 4)
Mini HDMI Adapter (if not using SSH, Raspberry Pi 4)
Ethernet Cable (if no Wi-Fi is availlable)
Wi-Fi Dongle (optional)
Raspberry Pi Case (optional)

Installing the OS on Raspberry Pi:

Download and install Etcher on your PC or Mac
Plug your microSD card into your PC or Mac using a microSD card adapter.

Using Etcher to write image to disk

Start Etcher and select the Raspberry Pi OS disk image you downloaded and your microSD card from the etcher interface. Press Flash and wait.

Activate SSH before first start

This step is very useful if you can’t connect to your Raspberry Pi to a screen. This trick will activate SSH on your Pi at first boot. With your MicroSD card still plugged to your PC or Mac, add a blank file named “ssh” to the root folder of the Raspberry Pi.

Additionally, you can set up your Wi-Fi credential before first boot. Simply create a file called wpa_supplicant.conf that contains the following information:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1  
country=  
network={
  ssid=""
  psk=""
}

The ISO 3166-1 country code can be found here. And setting the country code allows your Raspberry Pi to know the correct frequency to use the Wi-Fi correctly, namely the 5Ghz.

Next, plug the SD card into your Raspberry Pi, connect power and ethernet and boot it up.

Connecting to your Raspberry Pi via SSH:

Download and install Putty or MobaXterm or any of the smart phone apps that can set up an SSH connexon.
Start the SSH app or program.
Enter the IP address of your raspberry pi in the box that says “Host Name”. If you don’t know what is your device IP address, there are multiple ways of finding it.

Router Connected Device List

I recommend using an app like Fing to find the IP address of your Raspberry Pi.
As another solution you can go to your router admin panel using a web browser with the default IP address printed on the Router label.
Once you have access to that panel, there should be a tab that list all connected devices. Locating your Pi in that list shouldn’t be too troublesome.

Resolving local name with mDNS

Also, Raspberry Pis support multicast DNS fresh out of the box.
As such, if you are using a DNS compliant machine to access the Pi, you should be able to connect to it using it’s hostname with .local as the suffix. By default, the Raspberry Pi hostname is simply raspberrypi.
And, you can connect to it using raspberrypi.local.

In the “Saved Sessions” input box or tab, you can name your Raspberry Pi connection and then press “save”.
It’s very useful when you have several headless Raspberry Pi like I do.
Connect to the Raspberry Pi using the connect button.
Depending on the app you use, this button might be located anywhere.

Connecting to your Raspberry Pi via a monitor

Nothing is easier, simply connect a HDMI cable to your Pi and then into the monitor.
However, you might need a special adapter if you don’t have a HDMI port on your monitor.
Also, don’t forget to plug in your mouse and keyboard, or combo, when you are hooked to a monitor.

Raspberry Pi Set up your Pi and OS update

Once your Raspberry Pi boots up, log in using SSH or just by hooking it up to a monitor. To log in using SSH, the initial login credentials are:

  • User: raspberry
  • Password: pi

On a fresh Raspberry Pi OS load, I like to expand the file system and do a full package and distro update. As such, you should run sudo raspi-config and under “Advanced Configuration” select expand the filesystem to fit the whole SD card.

# Expand filesystem under advanced configuration
sudo raspi-config

# Fetch Update and upgrade all the packages
sudo apt-get update
sudo apt-get dist-upgrade -y

Tadam!
The installation of an OS to your Raspberry Pi is now complete.
Your new toy is ready to use!

Enjoyed this post?

Follow us on Pinterest for additional awesome ideas!​

Some posts on this blog contain affiliate links.
At no additional charge to you, I receive a small commission whenever a product is purchased through these links. The Dreaming Dad is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com.