If you just want an OS on your pi that is basic (no GUI, etc) for running pi-hole or whatever, then here is a method I use that works for me.

I don’t want to drag out a monitor and keyboard to set up a pi, either - I just want to put in the SD card, and put the pi where it will be used. This method does not require access to a keyboard and a monitor for the pi.

  • Get image for Raspberry pi from here: Tested images
  • Use balena etcher to burn the image to a SD card (I like 32 GB cards).
  • You can read about the defaults and configuration of the images here: raspi.debian
  • Some FAQ’s are found here: FAQ
  • The images do not have a password set for root, and do not have SSH access enabled, but you can fix that by modifying this file on the VFAT16 partition of the image to set hostname, and allow for SSH access, and a root password: /boot/firmware/sysconf.txt - add YOUR public key on the “root_authorized_key” line - then you can just SSH into the server with root@<hostname>
  • Run apt update after login, then install the locales package and set your locale with dpkg-reconfigure locales choose: en_US.UTF-8 (or whatever is correct for your locale).
  • Run tasksel install --new-install standard to add some basic stuff
  • Set timezone: Run timedatectl list-timezones to find the syntax for your timezone, then add it with: timedatectl set-timezone America/Los_Angeles
  • Install a few more tools: apt install sudo curl git vim nala
  • Upgrade everything, using nala, which is a nice front end for apt: nala upgrade
  • Reboot
  • Add user with adduser <username>
  • Add user to sudo with usermod -aG sudo <username>

NOTES

  • Set default editor to Vim, using: sudo update-alternatives --config editor
  • Edit /etc/network/interfaces.d/wlan0 for wireless access - if needed