Sunday, January 31, 2021

Configuring a Headless RPi

  • Install the OS Using the Raspberry Pi Imager.
  • Mount the SD card again in the Windows environment
  • To enable SSH, create an empty file named 'ssh' in the root of the SD card
  • To configure WiFi, create the wpa_supplicant.conf file in the root of the SD card
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    country=GB
    
    network={
            ssid="ssid"
            psk="psk"
    }
    
  • Boot the RPi with the card and run raspi-config to set hostname, interfaces etc.
  • Install Java with:
    sudo apt install default-jdk
      
    # or for older RPi mmodels
    sudo apt install openjdk-8-jdk liblog4j2-java wiringpi libmysql-java
    

Edit: turns out these can now be set up with the Raspberry Pi Imager v1.6, which is a lot easier...