If you don't mind the drama, both PFsense and OPNsense are perfectly competent router OSes.
Regarding hardware:
OPNsense also sells rack-mountable server hosts.
OP may not actually need a rack-mounted server -- I have several machines just sitting on a 2u rack-mounted shelf. My opnsense install runs on a cheap protectli box, and there's enough room for a handful of raspberry pis and their power bricks on the shelf next to it.
I'd recommend OPNsense over PFsense due to multiple shady moves by netgate (the parent company of pfsense), including moving to closed-source:
If you don't mind the drama, both PFsense and OPNsense are perfectly competent router OSes.
Regarding hardware: