Skip to Content
All memories

Raspbian Stretch headless

 — #raspbian#linux

To set any Raspberry Pi in headless mode, you’ll only need your Pi with pre-loaded Raspbian OS and your Wi-Fi network. Make sure you know your Wi-Fi SSID and Password in order to perform headless setup.

Once you’ve burned the Raspbian image onto the microSD card, connect the card to your working PC and you’ll see the card being mounted as “boot”. Inside this “boot” directory, you need to make 2 new files. You can create the files using any code/text editor.

Step 1: Create an empty file. Just name the file ssh. Save that empty file and dump it into boot partition (microSD). This file will enable ssh connection to your pi, which is by default disabled for security reasons.

Step 2: Create another file name wpasupplicant.conf. This time you need to write a few lines of text for this file. For this file, you need to use the FULL VERSION of wpasupplicant.conf. Meaning you must have the 3 lines of data namely country, ctrlinterface and updateconfig.

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="your_real_wifi_ssid"
    scan_ssid=1
    psk="your_real_password"
    key_mgmt=WPA-PSK
}

In the previous versions of Raspbian like Jessie there was minimalist config that did the trick, but on newer versions (Raspbian Stretch) it won’t work:

network={
	ssid="Your network SSID"
	psk="Your WPA/WPA2 security key"
}

That is all, now you can enjoy your headless setup with ssh access to your terminal.