macOS is explicitly designed to not be a server, and the consumer hardware it runs on is also designed that way. Apple even discontinued the Server tools that you could buy on the App Store that used to be called Mac OS X Server.
If you want to run Linux server apps, you should run Linux. Because Apple hardware and macOS isn't giving you any advantages over a generic piece of hardware running a Linux distribution. The hardware costs more and is less upgradable than off-the-shelf hardware.
Servers should not run desktop environments because they are a waste of resources and widen the attack surface due to having more components installed and running.
And even if you want a desktop environment for your Linux server, Linux most certainly has a wide selection of mature stable desktop environments.
If you need to do development work or just achieve the goal of running Linux applications on a Mac, that can be easily done via virtual machines, containers, etc.