How to write headless server

How can I write headless (console-only) server for Unity game? Proper server software becomes necessity for certain types of games (basically anything more than 2 player multiplayer), so I’m asking.

Well, you make a game that doesn’t need any rendering, and launch the application using the -batchmode flag. You don’t have to use Unity for a headless server.