Man, I could not find a tutorial for this anywhere. So, how to set up a static file server and captive portal on Ubuntu 24, including on a Raspberry Pi Zero 2W. It serves static files, broadcasts an open wifi network, and uses DNS + DHCP to direct people to a captive portal (both all-DNS method and DHCP option 114).
First, install the packages we'll definitely need.
sudo apt update
sudo apt upgrade -y
sudo apt install -y vim dnsmasq hostapd