Running a Unity Server instance on a LINUX server ??

Hi everyone !

I finished a multiplayer game in Unity, and now i want to run one sever instance of that game on my webhost server ( the game is basically one persistent server running, the players won’t be able to make their own game-servers, only join this one persistent game-server).

I got everything set up, but I now realised the OS of my webhost’s server is LINUX. I don’t see any Linux install build on unity’s website, but did come across Ubuntu’s Unity 8… (why is it called 8 and does not equal 5 like on windows or macOS ?)

My question: Will this work? Can I download and install a Unity linux version remotely (using SSH), and will it correctly run my Unity server instance. Until now I developed on macOS.

What are your experiences with this? Should i go to another webhost that runs windows on their servers? What are the command-line commands to remotely download, install and run Unity on Linux.

I know it’s a lot of questions but any help much appreciated, because at this point I’m getting really confused.
Thanx !!!

  • &apos

Build your server project as Linux (it shouldn’t matter what your dev platform is), and ensure to run it with the command line parameters -batchmode -nographics

1 Like

Thnx whippets!

Ah of course, you can choose the build platform before building the project sweet! (kind of forgot about that, silly me) … For some reason I thought unity had to be installed to be able to run a unity program, but I understand now that that’s not a unity program but a self-contained application. So I guess everything should work. Will get back to you! and like always thanks for the info man :slight_smile:

Just contacted my webhost-service and they don’t allow port-forwarding… guess I have to go to another one. :slight_smile:

1 Like

A Windows or Mac editor can produce Linux builds. Just copy it over to your Linux server, set execute permissions, and launch it. As far as actual steps, I generally create a .tar or .tar.gz file out of my build and use scp to copy it to my Linux server. For Windows you’d use pscp to scp it, and 7-zip is a good utility for making tar files and then compressing them into .gz files (or you can just get the real tar and gzip command line utilities).

To be able to launch your game you’d ssh into your Linux box, and do something like:
chmod +x ./<name_of_game_executable>

Then you’ll want to launch it most likely as a background task.

./<name_of_game_executable> &

You could also find the Linux “nohup” command useful when launching your server.

If you click the “headless” checkbox in your build options, you can avoid even this minor hassle :slight_smile:

(no need to specify those command line parameters if built as headless already)

What does this topic have to do with your Hotmail account?

Wut…

1 Like

For anyone bumping into this,
Using the ambersand (&) will still kill the process once you close your terminal. Assuming you have a dedicated server that you want to keep running even after you close your terminal you need to use nohup or disown.

For more info, check this article: https://www.makeuseof.com/run-linux-commands-in-background/

1 Like