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 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 …


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”.


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.


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.


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

22 thoughts on “Headless Raspberry Pi Setup with Raspbian Stretch (Pi 3B+ compatible)

  1. A nice tutorial.

    BUT if you use pibakery at would save a lot of work.
    You can set even up the WiFi. A really g0ood tool.
    Appantly there will be a new version at the end of March so it would be better go get that one when id arrives.

    1. Looks interesting indeed, I’ll have to check it out 🙂

      But I guess both approaches each have their pros and cons. With PiBakery, you are tied to the baked in image it seems (which makes it a 1.8GB download). Does it support different OSes?

      1. My old version has just updated the image to the latest Version and the Light version.
        Whether the new PiBakery support all available OS’s ifs not known.
        Pibakery is on twitter so perhaps a tweet there would not go amis.

        PS. I couldn’t get LAMP install to work, but will work on that.

  2. Thanks for this tip. How could I go this long and provision so many raspis. This will save me a lot of time.

    Thank you.

  3. This is just something extra that I learnt from your excellent article. I hope you don’t mind me sharing. Thank you very much for posting this article and sharing your knowledge.
    After powering up my raspberry pi zero after making the changes in the card’s root I powered it down and looked at the SD card again. I could not see the “wpa_supplicant.conf” file. I understand now that the operating system copies the file to where it needs to go then deletes the file from the microSD card’s root.
    Also in Windows I created the file ‘ssh’ but there was not just an option I believe to just create a file so I made a text file ‘ssh.txt’ then deleted the .txt bit which left just ‘ssh’ as a file. seemed to work.
    I found this article from

    1. I don’t mind at all! Thank you for the feedback, I’ve added some small notes in the text to cover it 🙂

      As for the file extension, I remember a trick in notepad when saving a file: if your put quotes (“”) around the file name, it should save as is, without adding a .txt extension.

  4. Very clever way of setting ssh and the wifi. Thanks a lot.
    I have a Pi Zero W and would like to just have the Jessie lite version on it but I just can’t get bluetooth to work reliably.
    Would you have a tutorial for Jessie lite and Bluetooth?

  5. It seems that bluetooth requires pulseaudio whcih really requires a desktop version itself. I have tried many things but have come to the conclusion that bluetooth is at best unstable on Jessie Lite.
    I would love to be proven wrong 🙂

  6. I have followed your tutorial and I think A small correction is required 🙂

    You say to put the ssh file and wpa_supplicant.conf in the root partition but it should be in /boot (as shown in the picture)

  7. It could be something specific to me then. I am very new to The Pi world so excuse my lack of knowledge.
    When I insert the SD card in my laptop it shows 2 partitions. 1 is the / and the other is /boot.

    I initially put the files in / and it didn’t work. That is when I then saw the picture and realised I put them in the wrong place 🙂

    1. I’m only seeing one partition, so I was not aware this could cause confusion 🙂 I’ve added the fact that it’s “/boot”. Thanks for the feedback!

  8. I’ve setup lite, done apt-get upgrade and it’s seems it turned to desktop version. Is there something like only security updates?

    1. I don’t think it’s possible to go from lite to desktop via the upgrade command, as it only upgrades the installed packages. To have a desktop, you would have had to install the graphical environment manually.

      Are you certain you started from Lite, not a desktop version booted to cli only?

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 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.