Source: https://gregology.net/2018/09/raspberry-pi-time-machine/
Install Raspbian Buster Lite on the SD card. Follow the instructions on the Installing images tutorial on the Raspberry Pi site. Then enable SSH. Insert the SD card into the Pi, plug in the USB hard drive, plug in a network cable, and power on the Pi.
Open Preferences and Raspberr pi configuration. Change the hostname to: "AirPort"
Next set a static IP address for your Raspberry Pi. Depending on your setup, you can either set the Pi to have a manual ip address or have your router assign a static IP address.