How ToIoT HardwaresRaspberry PiTutorials/DIY

How to use Raspberry pi in a truely headless mode

Raspberry Pi is a powerful, affordable, and compact computer that can be used for various projects, from home automation to learning programming. To set up a Raspberry Pi in headless mode (without a monitor, keyboard, or mouse), you need to install and configure Raspberry Pi OS for remote access.

In this guide, we will walk you through the step-by-step process of installing Raspberry Pi OS on your Raspberry Pi in headless mode.

Step 1: Gather the Required Materials

Before you begin, ensure you have the following:

  • A Raspberry Pi board (Raspberry Pi 4, 3, or any other model)
  • A microSD card (at least 8GB, preferably 16GB or higher)
  • A microSD card reader
  • A computer with an internet connection
  • A micro-USB or USB-C power supply (depending on your Raspberry Pi model)
  • An Ethernet cable or Wi-Fi connection (for internet access)

Step 2: Download Raspberry Pi OS

  1. Visit the official Raspberry Pi website: https://www.raspberrypi.com/software/
  2. Download the Raspberry Pi Imager tool for your operating system (Windows, macOS, or Linux).
  3. Install the Raspberry Pi Imager on your computer.

For headless setup, it is recommended to select Raspberry Pi OS Lite, which does not include a desktop environment.

Step 3: Flash Raspberry Pi OS to the MicroSD Card

  1. Insert the microSD card into your computer using a card reader.
  2. Open the Raspberry Pi Imager.
  3. Click on “Choose OS” and select “Raspberry Pi OS (Lite)”.
  4. Click on “Choose Storage” and select your microSD card.
  5. Click on the gear icon (Advanced Options) to:
    • Set up Wi-Fi credentials (SSID and password) for wireless connectivity.
    • Enable SSH for remote access.
    • Set a hostname and username/password.
  6. Click on “Write” and wait for the process to complete.
  7. Once the flashing process is done, safely remove the microSD card from your computer.

Step 4: Manually Enable SSH (If Not Set in Advanced Options)

If you didn’t enable SSH in the Raspberry Pi Imager, follow these steps:

  1. Insert the microSD card back into your computer.
  2. Open the boot partition of the microSD card.
  3. Create an empty file named ssh (without any file extension).
  4. If using Wi-Fi, create a file named wpa_supplicant.conf and add the following content:
    country=IN  # Replace with your country code
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    
    network={
        ssid="Your_WiFi_Name"
        psk="Your_WiFi_Password"
        key_mgmt=WPA-PSK
    }
    
  5. Save the file and safely eject the microSD card.

Step 5: Booting Up the Raspberry Pi (Headless Mode)

  1. Insert the microSD card into the Raspberry Pi.
  2. Connect the Raspberry Pi to power.
  3. Wait for the system to boot (this may take a minute).

Step 6: Finding the Raspberry Pi’s IP Address

To access the Raspberry Pi, you need its IP address. Find it using one of the following methods:

  • Log into your router and check the connected devices list.
  • Use a network scanning tool like nmap or Advanced IP Scanner.
  • If using Ethernet, try ping raspberrypi.local in the terminal.

Step 7: Connecting to Raspberry Pi via SSH

  1. Open a terminal (Linux/macOS) or Command Prompt (Windows).
  2. Connect using the following command:
    ssh pi@raspberrypi.local
    

    or, if using the IP address:

    ssh pi@<IP_ADDRESS>
    
  3. Enter the default password (raspberry), unless changed during setup.

Step 8: Updating and Installing Essential Software

To keep your Raspberry Pi secure and up to date, run:

sudo apt update && sudo apt upgrade -y

You can also install additional software as needed:

  • Text editor: sudo apt install nano
  • Python programming tools: sudo apt install python3
  • Git: sudo apt install git

Step 9: Enabling Additional Features

To enable advanced features, open the Raspberry Pi configuration tool:

sudo raspi-config

Navigate through the menu to:

  • Enable SSH, VNC, SPI/I2C, and other interfaces.
  • Set boot options (e.g., login automatically to CLI).
  • Configure overclocking settings if needed.

Step 10: Reboot and Start Using Your Raspberry Pi

After making all necessary configurations, reboot your Raspberry Pi with:

sudo reboot

Once restarted, your Raspberry Pi is ready to use in headless mode!

Conclusion

Installing Raspberry Pi OS in headless mode allows you to set up and control your Raspberry Pi remotely without needing a monitor, keyboard, or mouse. This method is ideal for IoT projects, servers, and remote computing. Happy experimenting!

Harshvardhan Mishra

Hi, I'm Harshvardhan Mishra. Tech enthusiast and IT professional with a B.Tech in IT, PG Diploma in IoT from CDAC, and 6 years of industry experience. Founder of HVM Smart Solutions, blending technology for real-world solutions. As a passionate technical author, I simplify complex concepts for diverse audiences. Let's connect and explore the tech world together! If you want to help support me on my journey, consider sharing my articles, or Buy me a Coffee! Thank you for reading my blog! Happy learning! Linkedin

30 thoughts on “How to use Raspberry pi in a truely headless mode

Leave a Reply

Your email address will not be published. Required fields are marked *