Windows dedicated server or linux dedicated server

im making my first multiplayer game. I’m trying to find out if I need to use Windows or Linux dedicated servers. Does it matter? Can I build on Linux, and can people play the game on Windows? How does this work? in my case, it doesn’t matter much because I’m making a browser game, but if it were standalone, then how does that work? if I build on Linux and I’m using Windows, will I be able to test it or still use the Linux build? Technically, I know I can’t, but since I followed a Unity tutorial on the small-scale competitive multiplayer project, it said to build a Linux server, so I am not sure if it matters or not.

Its the same deal as webservers, if you go to google, or microsoft do you know if you’re going to IIS or apache/tomcat? probably not.. the server end does not effect the client ends - which is why cross platform games are often the way of life, they dont have to match

so it doesn’t matter what i choose for the server. since it suggesting linux, then I guess its a better option? from what I read online its lightweight, affect performance and such.

Personally. As someone whos 9-5 is a senior unix admin. If you dont know unix. Dont go there until you do.

Yes. Unix is absolutely efficient. Unix systems in the days of yore were often up years without any need to reboot because well. You often really dont need to.

However. Unix is not forgiving to the new.

To run your server you need something to put it on. If all you have is windows. Stick with that for now.

You would install a VM (virtual machine) software and install Linux into that VM.

Then you can test as if you owned a separate Linux machine, except it’s using your computer’s resources. You ought to have plenty of RAM though and a beefy CPU. 6 cores and 16 GiB is on the lower end. 8-12 cores and 32+ GiB of RAM I would recommend. And definitely fast SSDs.

VM software often comes free, Microsoft provides one and VMWare has a free version, those are the main contenders.

Just a note of caution: yes, you can also work with the Unity editor in a VM. But this is not supported and any bugs you may be reporting will be dismissed.

One thing to be aware of: Windows webserver hosting costs premium, somewhere between 50% to 200% more. This is why Windows servers are so rare, besides Linux being better suited for the webserver hosting job.

Quick question since I have the opportunity here. How can I make builds for Linux? I don’t find many useful tutorials online. I set all the settings a Linux build requires, but when my friend who owns Linux tests it, it breaks. I also installed VM on my Windows and tested it myself. Now, just to clarify, I’m using Unity 2022.3 version, and my friend told me that his using an older version of Linux. This is what I also installed with his help. Either way, what settings does Unity Linux build need to make one? If you can share some guidance online that I haven’t found, it would be great.

Yes i have VM on my machine, i set it up to test builds for Linux. btw can you look at my other question and give some suggestions or help with that? i tried to make Linux build for one of my games and I can never get why it doesn’t work. Are the settings wrong? The Linux version? i don’t find many useful tutorials online about this

You probably have the “wrong” Linux. Unity has very specific requirements ie Ubuntu 22 or 24. But usually other Linux distros also work but that’s at your own risk.

So try installing the supported Ubuntu 24.04 into your VM and try with that.
Also test making a build of a blank project. That way you can be sure it’s not breaking due to your project’s contents.

ok thanks, i be sure to check it out

Like all things when not working you need your friend to be specific.

Uinitys build you will need to send the whole build folder, but also, they need to make sure they have all the base stuff. I can later dig out what some of the base stuff is.. cos I shoved mine in a docker container :smiley:

You don’t need to worry much about server OS. Linux is built is common platforms because it’s lightweight and easy to host, but your clients can still run on a Windows dedicated server with no problem. You can run a Linux dedicated server built on Windows, but you can test using a Windows headless build or a small Linux VM for browser games, which means even less.

like any program it can break on another machine when something set isnt quite right, so, for example, if you put in your IP, it will probably crash because it cant set that when it runs.. you dont say what happens other than “it breaks” how does it break?

I use a Windows PC, so when I build Linux or Mac builds. It needs settings, but I don’t know which to use to make it work on Linux builds. But I got some documentation and a VM to test it out later. It would be helpful if someone made a simple tutorial on YouTube on what settings it requires or what version of Linux is supported. On my friend’s device, it doesn’t work, probably because he’s got an unsupported version, but I will check it out when I get time

Well it kinda depends what didnt work..

I threw mine in a docker container.. it worked just great.. But then, Im a unix nerd .. its also my job :smiley:

depends on the config of the vm to be honest, if you get it its own IP not NAT it, then it could be accessible if the router is setup to do so, plus, if you use relay you dont need it to be accessible directly.

Controlling who accesses the server/game falls into the same rules as anything..

Of course it could be a linux server, but it could be windows, a vm, a docker anything.