Close

Headless Raspberry Pi Setup with Raspbian Stretch (Pi 3B+ compatible)

On Pi Day 2018, a new member was introduced to the Raspberry Pi family: the Raspberry Pi 3 B+.

Same price, same form factor, but increased CPU and network speeds (both wired and wireless), now with PoE capability in combination with a new HAT. Check out raspberrypi.org for all the details on this new model.

 

This post will guide you through the setup of the Raspberry Pi 3 B+, but can also be used for previous models such as the Pi 3 B, Pi Zero W, etc …

Prerequisites

Before starting, you’ll need the following hardware:

  • a Raspberry Pi 3 B+ or other model
  • a 8GB microSD card with SD adapter
  • a 5V/2.5A microUSB power supply

On the software side, following bits are required:

Prepare SD card

Insert the microSD card in your computer, using the SD card adapter and run the Etcher software.

  • Step 1: Select the downloaded Raspbian image (no need to unzip!)
  • Step 2: No action should be required, but it is recommended to verify Etcher picked the correct drive
  • Step 3: Flash!

Once the OS has been flashed onto the SD card, some files need to be added in order to enable SSH access and have the Pi connect to the desired network via WiFi.

Etcher automatically ejects the drive when the flashing procedure is completed, so you may have to remove and reinsert the microSD card in your computer.

  • to enable SSH access, create an empty file called “ssh” (no file extension!) and put it on the microSD card (/boot)
  • to enable WiFi, create a file called “wpa_supplicant.conf” with following content, on the microSD card (/boot):
Replace “<your_ssid>” and “<your_password>” with the values matching your own wireless network . Update the country code to match your own, and save the file. Upon first boot, the file will be moved to the correct location on the filesystem.

First boot

The microSD card is ready, time to boot up the Pi!

Safely eject the microSD card from your computer and insert it in your Raspberry Pi. Connect the WiFi dongle if your Pi doesn’t have onboard WiFi, and plug in the power adapter. Wait a moment for the Pi to completely boot, then, verify it is accessible.

In a terminal, try pinging the Pi using following command:

After confirming the Pi is on the network, connect to it via SSH. In Linux and OSX, you can do this via the terminal, in Windows using PuTTY.

The default SSH password is “raspberry”.

Configuration

On the command line, execute following command to start the configuration tool:

It is highly recommended to change the default password to something different. This can be done using the “Change User Password” menu option.

I personally like to change the hostname of every Pi in order to be able to differentiate them. To change the hostname, use the “Network Options” > “Hostname” option.

A reboot is required to apply all changes, which will be asked by the configuration tool upon finish.

Update/Upgrade

The final step is to update the software to the latest version.

Use the package manager to update the package lists to the latest version and initiate the upgrade.

Perform a final reboot, and you’re done.

Ready

The Pi is now connected to the network, running the latest software and ready to become part of a new project!

© Frederick Vandenbosch, 2014-2019. Unauthorised use and/or duplication of this material without express and written permission from this blog’s author and owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Frederick Vandenbosch with appropriate and specific direction to the original content.