These are brief instructions for setting up a headless Raspberry Pi in a controlled manner. I assume you’ve done this sort of thing before and are just looking for a quick reference.

Prep

First, get the Raspbian Lite image.

Use Etcher to put the image on an SD card. You can just use the Raspbian .zip file (no need to unzip).

Networking

Mount the rootfs volume on the SD card. You can do this from the file explorer GUI if you like. Open /etc/dhcpdcd.conf (as root) and set the configuration to something like this:

interface eth0 # or wlan0 for wireless

static ip_address=192.168.0.36/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

If you opt to use wireless networking, you’ll also need to edit /etc/wpa_supplicant/wpa_supplicant.conf to include the following:

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="YOURSSID"
    scan_ssid=1
    psk="YOURPASSWORD"
    key_mgmt=WPA-PSK
}

Then edit /etc/hostname to give a descriptive hostname. This is what will show up when you SSH in. Edit /etc/hosts’ 127.0.1.1 entry to match.

Mount the boot volume on the SD card. Create an empty file named ssh. This will enable SSH on first boot, so you never need to connect a keyboard and monitor.

Power on

Unmount the SD card and put it in the Pi. Connect the Pi and start it up. Change the password with passwd. Finally, install vim. Obviously.