How to Create or Install an Operating System for Raspberry Pi 4 Using Raspberry Pi Imager and a Memory Card

This article provides a practical and technical explanation of the topic, including real-world use cases and insights.

How to Create or Install an Operating System for Raspberry Pi 4 Using Raspberry Pi Imager and a Memory Card

A complete beginner-friendly tutorial to install Raspberry Pi OS on a microSD card, configure hostname, username, password, Wi-Fi, SSH, timezone, and first boot settings for Raspberry Pi 4.

“`
Raspberry Pi 4 Raspberry Pi OS Pi Imager microSD Card SSH Setup
“`

Introduction

“`

Before using a Raspberry Pi 4, you need to install an operating system on a bootable storage device, usually a microSD card. The easiest and safest method is to use Raspberry Pi Imager, the official tool provided by Raspberry Pi.

Raspberry Pi Imager allows you to select the Raspberry Pi model, choose the operating system, select the memory card, and configure important settings before the first boot. These settings include the username, password, Wi-Fi network, country, timezone, keyboard layout, and SSH access.

Download Raspberry Pi Imager
Important The microSD card will be completely erased during this process. Make sure you do not have important files on it before continuing.
“`
Image Suggestion 1 Add a screenshot of the official Raspberry Pi Imager download page here.
In WordPress, upload your screenshot to Media Library, then replace this box with an image.

Table of Contents

  1. Required hardware and software
  2. Download Raspberry Pi Imager
  3. Insert and prepare the microSD card
  4. Select Raspberry Pi 4 as the device
  5. Select Raspberry Pi OS
  6. Select the memory card
  7. Configure advanced OS settings
  8. Write the OS image to the card
  9. Boot Raspberry Pi 4 for the first time
  10. Connect using SSH
  11. Update the system after installation
  12. Troubleshooting common problems

1. Required Hardware and Software

“`

Before starting, prepare the following components:

Component Recommended Choice
Raspberry Pi Board Raspberry Pi 4 Model B
Memory Card microSD card, preferably 32 GB or more
Card Reader USB microSD card reader or built-in laptop SD reader
Power Supply Official Raspberry Pi USB-C power supply recommended
Internet Wi-Fi or Ethernet connection
Software Raspberry Pi Imager
Recommendation For Raspberry Pi OS with desktop, use at least a 32 GB microSD card. For server use, Raspberry Pi OS Lite can run on smaller cards, but 16 GB or 32 GB is still more comfortable.
“`

2. Download Raspberry Pi Imager

“`

Go to the official Raspberry Pi software page and download Raspberry Pi Imager for your computer operating system. It is available for Windows, macOS, and Linux.

Official Raspberry Pi Imager Download Page

Install Raspberry Pi Imager on Windows

  1. Download the Windows installer from the official page.
  2. Open the downloaded file.
  3. Follow the installation steps.
  4. Launch Raspberry Pi Imager from the Start Menu.

Install Raspberry Pi Imager on Linux

On Debian-based systems, you can install it from the terminal if it is available in your repository:

Install Raspberry Pi Imager on Linux
sudo apt update
```

sudo apt install rpi-imager -y
“`

Install Raspberry Pi Imager on macOS

  1. Download the macOS version from the official page.
  2. Open the downloaded file.
  3. Drag Raspberry Pi Imager to the Applications folder.
  4. Open it from Applications.
“`
Image Suggestion 2 Add a screenshot of Raspberry Pi Imager main window with the three buttons: Device, OS, and Storage.
Suggested caption: Raspberry Pi Imager main interface.

3. Insert the microSD Card

“`

Insert the microSD card into your computer using a card reader. Make sure your computer detects the card correctly.

Warning All data on the selected microSD card will be deleted. Double-check that you select the correct storage device inside Raspberry Pi Imager.
“`

4. Open Raspberry Pi Imager

“`

Open Raspberry Pi Imager. You will usually see three main options:

  • Choose Device: select your Raspberry Pi model.
  • Choose OS: select the operating system to install.
  • Choose Storage: select the microSD card.
“`

5. Choose the Raspberry Pi Device

“`

Click Choose Device, then select:

Option Value
Device Raspberry Pi 4

Selecting the correct board helps Raspberry Pi Imager recommend compatible operating systems.

“`

6. Choose the Operating System

“`

Click Choose OS. For most users, the recommended option is:

Use Case Recommended OS
Desktop use with screen, mouse, and keyboard Raspberry Pi OS 64-bit
Server, SSH, MQTT, Node-RED, Linux lab Raspberry Pi OS Lite 64-bit
Beginner with graphical interface Raspberry Pi OS with Desktop
For Raspberry Pi 4 Projects If your goal is to use the Pi as a server, MQTT broker, Node-RED server, or Linux administration lab, Raspberry Pi OS Lite 64-bit is a clean and lightweight choice.
“`
Image Suggestion 3 Add a screenshot showing the Raspberry Pi OS selection menu.
Suggested caption: Selecting Raspberry Pi OS inside Raspberry Pi Imager.

7. Choose the Storage Device

“`

Click Choose Storage, then select your microSD card.

Be Careful If you have multiple USB drives connected, remove unnecessary drives before writing the image. This reduces the risk of erasing the wrong device.
“`

8. Configure Advanced OS Settings

“`

Before writing the operating system, click Next. Raspberry Pi Imager may ask if you want to apply OS customization settings. Choose Edit Settings or open the settings menu if available.

These settings are very important because they allow you to prepare the Raspberry Pi before the first boot.

Recommended General Settings

Parameter Recommended Value
Hostname raspberrypi or pi4-server
Username mourad
Password Choose a strong private password
Wireless LAN Enable if you want Wi-Fi connection
SSID Your Wi-Fi network name
Wi-Fi Password Your Wi-Fi password
Wireless LAN Country DZ for Algeria, or select your country
Timezone Africa/Algiers
Keyboard Layout us, fr, or your preferred layout

Recommended Services Settings

Parameter Recommended Value
Enable SSH Yes
SSH Authentication Password authentication for beginners, SSH key for better security
Username for SSH mourad
Security Note Do not use weak passwords such as 123456, raspberry, admin, or your phone number. Use a strong password with letters, numbers, and symbols.
“`
Image Suggestion 4 Add a screenshot of the OS customization settings: hostname, username, password, Wi-Fi, locale, and SSH.
Suggested caption: Configuring username, password, Wi-Fi, timezone, and SSH before first boot.

9. Write the Operating System to the microSD Card

“`

After selecting the device, OS, storage, and configuration settings, click Write or Next.

Raspberry Pi Imager will:

  • Download the selected operating system if needed.
  • Erase the microSD card.
  • Write the OS image to the card.
  • Verify that the image was written correctly.

When the process finishes, Raspberry Pi Imager will show a success message. You can then safely remove the microSD card from your computer.

“`

10. Insert the microSD Card into the Raspberry Pi 4

“`

Make sure the Raspberry Pi is powered off. Insert the prepared microSD card into the microSD slot of the Raspberry Pi 4.

Then connect:

  • USB-C power supply
  • Ethernet cable if using wired network
  • HDMI screen if using desktop mode
  • Keyboard and mouse if needed
Tip If you configured Wi-Fi and SSH in Raspberry Pi Imager, you can use the Raspberry Pi headless, without screen, mouse, or keyboard.
“`

11. First Boot

“`

Power on the Raspberry Pi 4. The first boot may take a little longer than normal because Raspberry Pi OS expands the filesystem and applies your configuration.

After the first boot, your Raspberry Pi should connect to your network automatically if Wi-Fi or Ethernet was configured correctly.

“`

12. Find the Raspberry Pi IP Address

“`

To connect to your Raspberry Pi by SSH, you need its IP address. You can find it using one of these methods:

Method 1: Check Your Router

Open your router admin page and look for connected devices. Search for the hostname you configured, for example raspberrypi or pi4-server.

Method 2: Use ping with Hostname

Ping Raspberry Pi hostname
ping raspberrypi.local

Method 3: Scan Your Local Network

On Linux, you can use:

Check local network devices
ip neigh
“`

13. Connect to Raspberry Pi Using SSH

“`

If SSH was enabled in Raspberry Pi Imager, you can connect from your computer using:

SSH using hostname
ssh mourad@raspberrypi.local

Or using the IP address:

SSH using IP address
ssh mourad@192.168.1.104

Replace 192.168.1.104 with the real IP address of your Raspberry Pi.

First SSH Connection The first time you connect, your computer may ask you to confirm the device fingerprint. Type yes and press Enter.
“`

14. Update Raspberry Pi OS After Installation

“`

After logging in for the first time, update the system packages.

Update Raspberry Pi OS
sudo apt update
```

sudo apt full-upgrade -y
“`

After the update, reboot the Raspberry Pi:

Reboot Raspberry Pi
sudo reboot
“`

15. Optional: Open Raspberry Pi Configuration Tool

“`

You can use raspi-config to configure system options after installation.

Open Raspberry Pi configuration menu
sudo raspi-config

Useful options include:

  • Enable or disable SSH
  • Change hostname
  • Configure Wi-Fi country
  • Set timezone
  • Enable interfaces such as I2C, SPI, Serial, or Camera
  • Expand filesystem if needed
“`

16. Optional: Enable Interfaces for IoT Projects

“`

If you plan to use your Raspberry Pi 4 for IoT, sensors, LoRa, MQTT, or serial communication, you may need to enable hardware interfaces.

Interface Use Case
SSH Remote terminal access
SPI LoRa modules, displays, ADC modules
I2C Sensors such as BME280, INA219, OLED displays
Serial GPS modules, Arduino communication, LoRa HAT serial mode
VNC Remote desktop access

Open the configuration tool:

Enable interfaces
sudo raspi-config

Then go to:

Menu path
Interface Options → Enable SSH / SPI / I2C / Serial
“`

17. Recommended Basic Security After Installation

“`

After installing Raspberry Pi OS, apply these basic security steps:

  • Use a strong password.
  • Keep the system updated.
  • Disable services you do not use.
  • Use SSH keys instead of password login for better security.
  • Do not expose SSH directly to the internet without protection.

You can check your current username with:

Check current user
whoami

You can check the hostname with:

Check hostname
hostname
“`

18. Troubleshooting Common Problems

“`

Problem 1: Raspberry Pi Does Not Boot

  • Check that the microSD card was written successfully.
  • Use a good-quality power supply.
  • Try another microSD card.
  • Make sure you selected Raspberry Pi 4 in Raspberry Pi Imager.

Problem 2: Cannot Connect by SSH

  • Make sure SSH was enabled in Raspberry Pi Imager.
  • Check that the Raspberry Pi is connected to the same network as your computer.
  • Check the IP address from your router.
  • Try using the IP address instead of raspberrypi.local.
Example SSH command
ssh mourad@192.168.1.104

Problem 3: Wi-Fi Does Not Connect

  • Check the SSID and Wi-Fi password.
  • Make sure the wireless country is correct.
  • Try Ethernet first, then fix Wi-Fi from the terminal.

Problem 4: Wrong Keyboard Layout

Open the configuration tool and change the keyboard layout:

Keyboard configuration
sudo raspi-config
“`

Final Result

“`

At the end of this tutorial, your Raspberry Pi 4 is ready with Raspberry Pi OS installed on the microSD card. You should now have:

  • A bootable Raspberry Pi OS microSD card.
  • A configured username and password.
  • Wi-Fi or Ethernet network access.
  • SSH access enabled.
  • Correct timezone and keyboard layout.
  • An updated Raspberry Pi system ready for projects.
Example Username mourad
Example Hostname raspberrypi
Example SSH Command ssh [email protected]
Recommended Timezone Africa/Algiers
“`

Official Links

“`

Use the official Raspberry Pi website to download Raspberry Pi Imager and read the official documentation:

“`

Conclusion

This article highlights key aspects and practical applications of the discussed technology.

References

  • IEEE Xplore Digital Library
  • SpringerLink Research
  • Google Scholar

Author: Mourad Elgorma
IoT & Networking Specialist

👉 Read more: Explore more ICT articles

Choose your Reaction!