Raspbian Stretch Headless Setup on Raspberry Pi Zero, Zero W, Pi 3

No Keyboard, Mouse, Display, HDMI or USB Converter is required!!

Works on Raspberry Pi 3, Pi Zero and Pi Zero W

Months back, We had published a guide for setting up Raspbian Jessie on Raspberry Pi without Keyboard, Mouse and External Display. Today We are back with an another guide for Raspberry Pi 3Raspberry Pi Zero W and yes there is no need of any accessories like described earlier, which add up cost to our low budget Raspberry Pi setup. There are lot of guides available over the internet with label of “Headless” but most of them do not contain complete information required for successful headless setup. So let’s get started!!

Hardware Required:

Software Required:

Step A:

  • Download and install SD Formatter from SD Association website.
  • Download and install Etcher from etcher.io.
  • Download and install 7zip from 7-zip.org.
  • Download and install Notepad++ (Windows Notepad will also work).
  • Download latest version of Raspbian which is Stretch (Raspbian Stretch with Desktop / Raspbian Stretch Lite) from official Raspberry foundation website.
  • Extract Raspbian Stretch image using 7zip.

Step B:

  • Insert the MicroSD card into card reader and mount it on to USB port.
  • If you have old version of Raspian Jessie on to the card, just format the card using SD Formatter.
  • Run Etcher and select image extracted already from downloaded zip file.
  • Select SD Card drive.
  • Hit Flash button and wait few minutes.
  • On windows 10 various pop ups many emerge, just ignore them and wait until it will say Flash Complete!
  • SD Card may be unmounted automatically after flash process completes, unplug the SD card reader and plug it back.
  • Ignore all errors messages pop up after inserting the SD Card Reader back and go for step C.

Step C:

  • Reinsertion of SD Card will create two more drives in My Computer section.
  • Ignore any errors or pop ups emerge (Do not format the drive this time as asked by Windows).
  • Open up the Drive with “boot” volume lable.
  • Create a new blank notepad file and save it in the boot drive as “ssh” without any extension in the end (See video for better understanding).
  • Creating “ssh” file will enable ssh access and We’ll be able to configure our Raspberry Pi Zero Remotely.
  • Create a new file in the same drive with name of “wpa_supplicant.conf” without any extension in the end and paste the following contents in there (Change SSID and Password according to your own network).
  • wpa_supplicant.conf file will be copied to /etc/wpa_supplicant/ directory on boot and our Pi will be connected to WiFi network automatically.
  • Save the “wpa_supplicant.conf” file and remove Micro SD Card Reader.

Step D:

Assigning Static IP address

  • Open “dhcpcd.conf” file in Nano editor
  • Scroll all the way to the bottom of the file and add one, or both of the following snippets. Depending on whether you want to set a static IP address for a wired connection (eth0) or a wireless connection (wlan0)
  • Save the configuration file by pressing “Ctrl” and “X” key followed by “Y” and “Return” key

Important Note:

Hence, ssh is now enabled, it is recommended to change the default password. Adopt the few extra steps as following;

  • Open up a new ssh session using PuTTY
  • Type passwd  and press Enter key
  • Enter raspberry  which is assigned as default password to user pi
  • Enter new password of your choice and press Enter key
  • Confirm your new password by typing it once again and press Enter key
  • A new message passwd: password updated successfully  will confirm that you have successfully changed your default password for user pi.

MicroSD Card Life Saving Trick:

If you have spent enough time with Raspberry Pi then you may know that Micro SD Card gets corrupted too early which is related to number of writes your operating system made on to the MicroSD Card. Number of applications are writing to log file frequently and hence participate in major share in depleting write capacity. Log2Ram offers storing log data to RAM by mounting  /var/log  into RAM which is stored in MicroSD card before safely shutting down the system. Follow the instructions below to install Log2Ram in to Raspberry Pi.

  • Install git in case of using Raspbian Stretch Lite
  • Fetch the installation from GitHub repository
  • Giving execution rights to script
  • Run the install script
  • Reboot the Pi
  • After reboot, you can check if mount is successful or not



Leave a Reply

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

All orders confirmed by 3:00 PM will be shipped on same day. Estimated delivery time is 24-48 hrs. Dismiss