Sometimes you may want to set up a Raspberry Pi without connecting it to a TV / monitor, keyboard, mouse or network cable. I recently did this for my Raspberry Pi Zero and decided to create a quick guide in case I need to do it again in the future.
- Download Raspbian OS, personally I went with Lite version for my Pi Zero as I don’t need a full desktop on it. At the time of writing (March 2019) Raspbian is on the release called Stretch.
- Write the Raspbian OS to a microSD card. For this step I used my MacBook and the application called Etcher.
- After writing the Raspbian OS to the microSD card two files need to be added to the root directory of the microSD card:
- This file should be created in a text editor (not a word processor) and should contain the following lines:
- country; this is the country code. For Great Britain it is GB. For other countries see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
- ssid; this should be the name of your wireless network
- psk; this should be the password used to connect to your wireless network
- This is just a blank file, no need for any content or file extension
The microSD can then be placed into the Raspberry Pi and the Pi can be booted. After a few minutes it should show as a connected device on your wireless networks router, and should be reachable via an SSH connection. To connect via SSH open a Terminal (MacOSX, Linux) or Putty (Windows) and connect using:
Replacing IP_ADDRESS_OF_PI with the Raspberry Pi’s IP address (e.g. 192.168.0.2).
The default password of the user pi is raspberry, once logged in make sure to change this default password to something more secure. To change the password type:
in the SSH terminal / putty window.