Raspberry Pi 4 setup headless

Recently, I bought a Raspberry Pi 4. It’s better for me to record all the steps to setup my Raspberry Pi headless.

  • Download Raspberry Pi OS from https://www.raspberrypi.org/software/operating-systems/
  • Burn the image to the micro SD card, I use rufus, which can be found at https://rufus.ie/
  • Write an empty text file named “ssh (no file extension) to the root of the directory of the card. 
  • Setup a Wi-Fi connection for your Raspberry Pi. Create a text file called “wpa_supplicant.conf“, and place it in the root directory of the microSD card. You will need the following text in the file.
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
scan_ssid=1
ssid="your_wifi_ssid"
psk="your_wifi_password"
}
  • Open “config.txt” from the micro SD card root folder. Uncomment out the following code
hdmi_force_hotplug=1

hdmi_drive=2
  • Insert the micro SD card to Raspberry Pi and boot up.
  • Connecting via SSH. I use Putty, which can be downloaded from https://www.putty.org/
  • Enter “raspberrypi” or “raspberrypi.local “as the address you wish to connect to in Putty, and click Open. 
  • Enter “pi” as your username and “raspberry “as your password. 
  • Enabling and Connecting over VNC
sudo raspi-config
  • Download, install and launch VNC Viewer to connect raspberry.