I would prefer to have both firewall that is both have equal importance, software firewall as well as hardware firewall.
On Linux server, Config Server Security that is CSF is widely used. It is best among all.
Now a days, firewall has the both configuration, hardware as well as software firewall. Hardware firewall was previously used with the systems having broadband devices connected to it. Those used to filter the packets.
Software firewall is now used worldwide. It has the number of customization option. You can set number of rules in the software firewall.