Skip to content

Instantly share code, notes, and snippets.

@JuanM04
Created April 19, 2022 20:27
Show Gist options
  • Save JuanM04/d816dfa7743acd848a7ac5610cea7150 to your computer and use it in GitHub Desktop.
Save JuanM04/d816dfa7743acd848a7ac5610cea7150 to your computer and use it in GitHub Desktop.
Headless Raspberry Pi

Headless Raspberry Pi Setup

  1. Flash a copy of Raspberry Pi OS into a MicroSD (you can use Etcher).
  2. Go to the boot drive (with Ubuntu, it's in /media/$USER/boot).
  3. Create an empty ssh file with no extension.
  4. And finally, create a wpa_supplicant.conf file with this data:
country=AR
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
  ssid="WIFI_SSID"
  scan_ssid=1
  psk="WIFI_PASSWORD"
  key_mgmt=WPA-PSK
}

With the steps above done, now you can ssh into it with ssh pi@raspberrypi.local (or pri@192.168.X.X) with the password raspberry.

Then, I do what any Linux-user does:

$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install python python-pip python3 python3-pip -y
$ passwd

If you have the error Can't set locale; make sure $LC_* and $LANG are correct!, you should sudo dpkg-reconfigure locales and select your locale (I selected en_GB.UTF-8 and es_AR.UTF-8... just in case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment