Steam for Linux

Steam for Linux

malex2200 Mar 5, 2024 @ 7:01am
Help Building an Ubuntu Game Server
Hi all,

I have been studying for Server+ and Linux+ certification and want to test myself by way of building a small gaming server to run Stardew Valley (or some other none resource intensive game) for myself and a few friends.

I have built an Ubuntu Server using an old HP EliteDesk 800 mini desktop, but am uncertain of how to proceed with applying the games and creating the network connections for friends to join.

Any help is appreciated.

Thanks.
< >
Showing 1-3 of 3 comments
HighBall Mar 5, 2024 @ 1:20pm 
Damn, I normally run all my services through a Docker container with Caddy serving traffic to my dockerized services. Been a while since I had a service raw dogging the metal. Let me see if I can at least get you pointed in the right direction and hopefully someone else who still raw dogs their servers can chime in.

1. You friends need to know what your server IP address * is. so `ip addr` will give you a list of devices and a bunch of network info. It depends how your network card driver names itself, but look for something like eth0. Give that IP address to them. That's how they can connect directly. *If you are behind a router see below

2. Your game will run on a specific port. Something like 5000 or 30000. Something ridiculous. You need to make sure the servers firewall is not blocked (set to deny). I believe Ubuntu uses ufw now. So something like `sudo ufw allow 5000` firewall docs[ubuntu.com] You may also need to specify tcp or/and udp but that depends on the game. If you expose both, I don't think anybody is going to die.

3. If you are behind a home router. Like your home wireless hotspot. You'll have to also open the port there and make sure it forwards to your server IP. If this is the case, then You no longer give your friends the ip address from step one. You now have to look at the WAN ip address, give that ip to your friends. And forward the desired port traffic (like 5000) to your server ip address you got from step 1. These days, the routers have pretty easy UIs. So just go to the admin section and look for port forwarding. The router can accept on a port number and redirect to the different port number on the server. Unless you need that, it's best to just keep the external port and internal port the same.

#Remember, port 5000 is just an example port, it could be anything. I don't know what port Start Dew Valley listens on, or what other game you might want to host, but which ever port they default to, it's best to just stick with those port numbers.

You could also setup systemD service to automatically start your game service on reboot, but that's probably a stretch goal for now.

I'm just a software dev. Usually at the companies I work for there are actual server guys to do all the caring about server stuff. So if a server guy jumps in and tells how to properly do everything, please defer to him. But, at minimum this should get you going in the right direction.
Marlock Mar 6, 2024 @ 1:29am 
Also have a look at this nifty tool, if it still existst:

https://www.gamingonlinux.com/articles/need-an-easy-way-to-manage-a-linux-game-server-linuxgsm-is-great-and-recently-passed-100-supported-titles.15249

LinuxGSM is a Game Server setup helper tool. It uses scripts to automate the installation and configuration of each of over 100 game servers (somewhat like Lutris does for Wine games)
Last edited by Marlock; Mar 6, 2024 @ 1:29am
malex2200 Mar 6, 2024 @ 8:54am 
Thank you both for your help. I'll look into those articles.
< >
Showing 1-3 of 3 comments
Per page: 1530 50

Date Posted: Mar 5, 2024 @ 7:01am
Posts: 3