A Guide to Setting Up Raspberry Pi OS: Step-by-Step Instructions

Fatima SenouciFatima Senouci
5 min read

Introduction

Welcome! If you're looking to set up Raspberry Pi OS on your new Raspberry Pi, you're in the right place. Whether you're a first-time user or looking to refresh your knowledge, this guide will walk you through the entire process step by step.

In this article, I’ll share my experience and tips to help you successfully install and configure Raspberry Pi OS. Whether you’re setting up for a specific project or just getting started with your Raspberry Pi, these steps will ensure a smooth setup.

Before we begin, make sure you have at least a 16GB SD card ready.

Step 1: Prepare Your Tools

  • First, go to your browser and install the Raspberry Pi Imager. It provides different Linux distributions for your Raspberry Pi.

  • Install Bonjour on your computer.

Bonjour is Apple's implementation of zero-configuration networking (zeroconf), a group of technologies that includes service discovery, address assignment, and hostname resolution. Bonjour locates devices such as printers, other computers, and the services that those devices offer on a local network using multicast Domain Name System (mDNS) service records.

install

  • Install PuTTY for SSH access.

PuTTY is a free and open-source terminal emulator, serial console and network file transfer application. It supports several network protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection. It can also connect to a serial port. The name "PuTTY" has no official meaning.

  • Install the necessary USB drivers called RNDIS/ETHERNET Gadget

  • Install VNC Viewer for remote desktop access.

  • Install SD Card Formatter.

Step 2: Format Your SD Card

  • Insert your SD card into the card reader and plug it into your computer.

  • Run the SD Card Formatter and format your SD card to ensure that it doesn’t contain any data.

Step 3: Install Raspberry Pi OS

  • Open Raspberry Pi Imager, and choose your device, OS, and storage (which is your SD card). Make sure that you’ve selected your SD card to avoid deleting other storage devices.

  • Before clicking “Next,” press Ctrl + X to access advanced options.

  • A menu will appear where you can configure the Raspberry Pi name, OS, Wi-Fi, and SSH settings.

  • Enter your Wi-Fi SSID and key, then enable SSH.

  • Click “Next” and proceed to write the image to the SD card. Wait until it’s finished, then remove your card reader and plug it back in.

Step 4: Configure Your SD Card

  • Open your SD card, and you’ll see some folders and files on it.

  • Create a new file and name it ssh (without any extension).

  • Next, edit the config.txt file. Since this is a sensitive file, open it with Notepad++.

  • Go to the end of the file and add the following line:

dtoverlay=dwc2

Save and exit

  • Now, edit the cmdline.txt file. Scroll until you find rootwait, and add the following command after it:
modules-load=dwc2,g_ether

Step 5: Connect Your Raspberry Pi

  • Make sure you have an OTG Ethernet Gadget cable to connect your Raspberry Pi to your PC. While it’s possible to connect using only Wi-Fi, I prefer using the Ethernet Gadget with an OTG cable for a more stable connection and to avoid bugs.

  • Once your connection is set up, run PuTTY.

  • Enter raspberrypi.local to connect via SSH, and log in using the username and password you set up earlier when you wrote the image.

Step 6: Final Configurations

Now that you’re logged in, you can access your Raspberry Pi. Before accessing your VNC Viewer, run some commands to optimize performance:

  1. Administrator Mode:

    Use sudo for all commands to ensure you have administrative privileges.

  2. Configuration:

    run this line to access the configuration tool.

     sudo raspi-config
    

    -Go to Advanced Options and enable Camera, VNC, SPI (communication protocol), Serial Port, and Remote GPIO.

    -Go to Localization Options to change the time zone, language, etc.

    -Finally, in Advanced Options, run the Expand File System option to make sure the system occupies all the space on your SD card.

    1. Update Software:

      to update all the software on your Raspberry Pi run this line .

sudo apt update

and to check and install the necessary software run this line .

sudo apt upgrade

Verify if Python3 is installed by running:

sudo apt install python3
  1. Reboot: Once everything is installed, reboot your machine with:
sudo reboot

This command will take 2-3 minutes. The SSH connection will be lost during this time, but you can reconnect using PuTTY.

Step 7: Access Your Raspberry Pi Using VNC

To access your machine using VNC, you’ll need the Raspberry Pi's IP address. Use the following command to get it:

hostname -I

Finally, go to your VNC Viewer and enter the IP address to access your Raspberry Pi remotely. Voilà!

Conclusion

Setting up Raspberry Pi OS might seem challenging at first, but by following these steps, you can have your Raspberry Pi up and running in no time. From preparing the necessary tools to configuring your device, each step is essential to ensure a smooth and successful setup. Whether you're using your Raspberry Pi for AI projects, programming, or simply exploring the world of computing, this guide should help you get started with confidence.

Remember, the Raspberry Pi is a versatile and powerful tool, and with the right setup, it can be tailored to suit a wide range of projects. Don’t hesitate to experiment and explore further possibilities. Happy computing!

0
Subscribe to my newsletter

Read articles from Fatima Senouci directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Fatima Senouci
Fatima Senouci

Hello! I'm Fatima, a dedicated coder and military officer with a Master’s degree in Computer Science Engineering. My journey in tech is driven by a passion for problem-solving and innovation. Currently, I’m deepening my skills in web development, focusing on tools like Tailwind CSS and Alpine.js, all while participating in the #100DaysOfCode challenge.