Host Dedicated Steam Game Servers with Linux - Palworld, CS2, SteamCMD!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
attention all Epic Gamers it is time to set up that dedicated power World server for the girls or that Counter-Strike 2 server for the boys it is so much easier than you think to set up a community server for these games valve makes it super easy with steam CMD we're going to get into it last night I was playing Five versus 5 competitive I got all the homies around and we played competitive bomb diffusal Counter-Strike Minecraft it was insane so much fun so worth it we're going to get into it like just look at this side who would not want to play this map it's so good step one of course is to actually get a Linux box now a couple ways you could do that you could just host it on a local machine on your network if you've already got a home server great you can just use that if you're interested in setting up a Home Server I actually have a complete start to finish guide on setting up a Debian Linux Home Server you could also pay some dude in the cloud five bucks a month to hire out a VPS great internet connection if it gets compromised who cares uh you could host it on AWS I don't know fill it out out there's plenty of ways to get a Linux box if you're running it on the Linux desktop like if you're just running that as your OS you can just use that there's plenty of ways plenty of ways go ahead and log onto your Linux box I'm going to be using this one right here this is just running on my local network it's actually a virtual machine on my server because the next part we're going to talk about is architecture so before we actually go ahead and install this you're going to want to choose how you want to set it all up there are three major ways that I kind of think about it when I'm looking at doing this stuff and what you'd prefer kind of depends on you so the first way is to run it all bare metal locally so you would just install Steam steam CMD onto your Local Host like this and just download all of the games and just run them like normal now the thing is that's very easy to do and it makes it all like super simple but if one of them gets compromised the entire machine gets compromised basically um and that's not necessarily a problem if you are just renting out a VPS like who cares um um or if you're you've got a dedicated machine for this stuff like who really cares you know but if your server is going to be running other stuff as well you might want to consider the second option which is running this through Docker now steam CMD does come with an official Docker image that you can grab when you're doing this with Docker there's like one more architectural decision you're going to have to make and that's how you containerize your servers so essentially the two main ways I can think of off the top of my head is you would have a Docker container in the first in for every individual game server so in that case you would grab steam CMD the docker image and download that for as many game servers as you need and then inside that Docker container you log on to each individual steam CMD instance and you download the game servers now that is probably the best for security because if one of the servers gets compromised only that Docker container is compromised however it does make it super annoying to manage all of your files because you've got different steam CMD instances managing all of your game files and you've got different Docker containers where all of those files are located you could kind of Remedy this by having like a common downloads folder that you pass into the docker container but again it it kind of does make it a bit annoying and the second way that you could do this with Docker is if you have one single Docker container that runs all of your game service on it now in this scenario it's more secure than the bare metal approach where you just run it you know through apt um or or or your package manager on whatever Linux distory you're getting because in the event that one of the game servers gets compromised sure all of your game servers are compromised like they've got access to that Docker container but nothing else on the machine is compromised so you might want to consider that approach because it makes one steam CMD instance to manage all of your game servers all of your game files are located in the same Docker container and it does make it a bit easier to uh to manage all of that now a third option and this is the one that I'm actually going to be going for I'm going to use a virtual machine now the reason for that the first the first reason for that is because my um Home Server actually runs free BSD so you know steam CMD doesn't have that so what I'm going to do is just spin up a Linux VM and and have it run that but another reason I'm doing this instead of Docker is because when you're port forwarding like Docker ports essentially so when you're running your server inside the docker container you can pass ports through it so they would act as if the when you connect to the host of the docker machine on a particular Port that goes to the docker container running your server instead which is what you want when you're running a game server now the problem with that is that you have to decide that when you create the container for the first time and to my knowledge it is not easy to change so in the situation like that where I'm going to be running this essentially all I'm going to go for the one steam CMD instance approach where I just run all of the Game servers off of one steam CMD instance running it in a virtual machine like this means that I don't have to worry about any of the docker port forwarding Shenanigans I can literally just configure this VM and if it gets compromised who cares it's a virtual machine that's what I'm going to be going for so grab up a root shell on your Linux box whether it's the bare metal host the VM or the docker container you're going to be installing steam CMD into and um we're going to go ahead and take a look at this documentation now if you're running the docker image you probably won't have to install all this it'll probably be set up for you but if you're doing this on bare metal or a VM like me I'm going to walk through it anyway so here on the steam CMD page and of course I'll link this in the description it shows you a couple of very common Linux distributions um package repositories basically so essentially you know on Ubuntu this is what you'd run if you're running Ubuntu server on Debian I'm going to be installing this on deian so this is what I'm going to be following um but after you do this all all of them should essentially be the same so I'm going to grab the stuff for Debian now copying and pasting commands from the Internet is a bit sketch so just walk through all of them and make sure you understand what they're doing so pseudo app update just updates our package list that's fine pseudo app installs software properties common just installs a package from the official repositories that's also fine appt add repository non-free of course steam has non-f free components and the non-free repo is an official Dean one so that's fine uh add architecture i386 like add support for 30 2 bit software packages that's again fine and then update our package repositories again so this command is totally chill to just go ahead and uh and copy paste so go ahead and do that I've already gone ahead and done this so it's not going to prompt me really for for anything but for you you might have to say yes to a couple commands um you know but essentially after that's done it's literally just apt install Steam CMD and again I've already done it but it'll prompt you to install it if you haven't already already now the next thing they suggest is to create a user to run Steam CMD as so again it's a security thing if that gets compromised you're not running the game server as root you're running it as a separate user so hopefully only that users access is compromised so to do that you can just go ahead and do user ad- M and then the name of the user I already have made a steam user so I'm not going to go ahead and do this but it's literally you hit enter it'll make the user it's as simple as that and then after you've done that you can set a password for the user with this command I'll just set a password password one how secure is that so essentially what you've done is you've added the uh repositories that steamcmd is in you've installed Ste steamcmd and you've created a user for it to run as we're absolutely Bing chilling guys now all we have to do is go Sue steam that will change change our user to the steam user we can CD to our home directory right here and you see that's home steam so now we are ready to download our games basically so to do that all you want to be doing is launch the steam CMD command and it'll start up download the Steam client libraries and everything like that and then once that's done it'll give you a shell prompt essentially that you can go ahead and access Steam apis and things from which is what we're going to be doing to download our games now there's a couple of different ways that we can go ahead and access the steam apis number one is you can log in with a steam account now they do actually recommend so I'll pull the documentation back up as you can see they recommend that uh you create a new Steam account for dedicated service so um I'll just make this a bit bigger so you can see uh create a new Steam account for the dedicated server so don't use the one with your like thousands of dollars in Counterstrike skins all right it's not a not a great idea but alternatively you can also log in as Anonymous so you don't even have to use an account for a lot of game service if you've got a particular game that you might have paid for that requires you to log in to an account that's purchased that game you might need to do that um I personally haven't come across any power world and Counter-Strike don't require you to do that and those are the only ones I've set up so far so I've only ever had to log in as Anonymous here but essentially now that this is done we're at the steam TMD password prompt so what I'm going to go ahead and do is log in as Anonymous and it'll connect us up and yeah we're basically done so so a couple of options here the next step on the steamcmd wiki is downloading an app so what you can do here is to this this option right here right Force install directory we're all probably familiar with steam apps common and then the game files right if you don't set this for Force installed uh it'll do exactly that so it'll create a folder in your home directory called steam it'll make Steam apps it'll make common and that's where your game servers and files going to be located if you want to change that you can set Force install directory to a certain path before you download the game so if you wanted to change they've got a Counter-Strike Global Offensive one here rip CS go I miss you miss you but um you can set that right here and then when you do this next section down here where you actually download the game it'll download to that personally I don't really care for this having them all in Steam maps common is fine it works great with my muscle memory so I don't care I just thought I would say that if you know you are someone who wants to do that so the next thing uh we want to go ahead and do is this app update command is what we're actually going to use to download our game servers now you're going to need to get uh the app ID of the game servers that you want to run popular games you can kind of just Google it and get the answer so this is the one for power world um so I'm just going to go ahead and copy that cuz I haven't got it memorized um so here we can do app update and this is where we're actually going to download our apps so I'll start with Counterstrike 2 so Counter-Strike 2 is the one I have memorized it's just 730 pretty easy to run a CS2 dedicated server you need to download the entirety of CS2 so if you just go app update 7:30 it will go ahead and download the entirety of CS2 um and then from there you can configure it to be a dedicated server which we'll get to in just a minute this same process is it's identical for power right so what I'm going to do is just cancel that real quick we'll go through it again just for power world from start to finish so grab steam CMD login Anonymous wait for us to connect and then app update and then power world's ID is this so it'll go ahead and start downloading power world now I'll let these download and come back to you real quick quick so they're both done downloading um I also downloaded the Counterstrike Source dedicated server because I if you didn't notice in one of my previous videos I was actually surfing on my own dedicated CS s surf server so I already had that one uh sort of in the background but you can see right here it's created a steam directory so we can go ahead and have a look at that steam directory and um you'll notice that this is like identical to what the regular steam client sort of produces so we can go steam apps common and you'll see your dedicated service that you've downloaded now CS2 is still called Counter-Strike Global Offensive even though it is CS2 it's kind of funny how that works but essentially yeah so you can go ahead into the common directory and just list out all your servers so we will start with the CS2 dedicated server because that one is pretty simple pretty easy to get off off the ground so if you go to the uh the directory for it and type LS there's a game folder and inside the game folder there's a bin folder and inside the bin folder there's a Linux Steam rt64 folder uh and inside this folder if you CD to it and do an LS there's all these files here this is the file we're interested in it's CS2 that's the executable for CS2 now um what I would recommend you do is create a startup script so I've already got one here from when I preconfigured this so I'll go ahead and open that up for you if you just create a start.sh um you can start it off with a shebang at the top check what your shell interpreter is on Debian it's user bin bash and then from there you can say CS2 and then pass it some options so the only options that I found relevant for me there's a bunch more there's actually another um there's another dedicated server for CS2 page on the valve developer Wiki I will just bring that up real quick um so it's this one right here and it should have command line parameters so you can set all of these different ones if you so desire these are the only ones that were really relevant for me and my purposes so you give it the dedicated option of course you're going to need that the port that you want to run it on so one thing to note is that when you're running these Game servers they all need different ports because when you port forward this in your router for your friends to come and join you can't all be running them on the same port so it's good to just dedicate a port I think the default one is 2715 for a lot of Steam games um so just make sure you set it explicitly to something different and then I've just said the starting map is going to be dust two classic if if cobblestone was still in the game that would be my starting map but it's do two for now so once you've made that startup script you can go ahead and start it so we'll run with start although you'll have to if you've just made it you'll have to chamod markers executable um so if we go ahead and start start.sh you'll notice a couple of things it's going to complain and the reason it's going to complain is because it can't find this module here steam SDK 64 Steam c.so and the reason it can't find that is because if you have a look at our steam directory now this happened to me on Debian it may not happen to you but if you get this same problem I'll show you how to fix it real quick so if you actually go ahead and do a listing of and it's actually bugged out my terminal okay so after having that bug out my terminal I just relogged in and uh we're back at the home directory now the file that it was complaining about not finding if you remember was steam c.so so if we want to go ahead and find that let's try and find that so if we go to steam and we have a look at Steam and we have a look at steamcmd I can type that correctly you'll notice we've got two folders here one is called Linux 64 the other is Linux 32 now if we go to Linux 64 we actually have Steam c.so here in Linux 64 so what we have to go ahead and do is Create a Sim link to this folder to the one that it was looking for so to do that you can type ln- S for a Sim link and the way that I remember the arguments is that the S stands for Source it doesn't actually stand for Source but you put the source first so home/ steam. steam uh and then we're looking for steamcmd SL Linux oops I forgot another steam in here steam Steam MD Linux 64 and now we are going to sim link that and take note when you specify the source it has to be the entire path you can't use relative path or it'll bug out um so you can then go ahead and set that to home steam do steam uh and then it should be SDK 64 in this folder so let's go ahead and look at our Steam folder and you can see we've got another Sim link here to SDK 64 now if you're setting up a cam Strike Source server as well you'll need to do the exact same thing but for SDK 32 like that so now if I look at my folder again you can see I've got these two SIM links here now if I go back to my Counterstrike server real quick if I can find my way back I always forget how to navigate back uh Global Offensive uh game bin Linux now if we go ahead and start this up again you should notice that it's actually going to start up correctly this time and you can see that it's loading in all of our all of our stuff and it should start dust two yeah here we go loading dust two basically now one little tip that I've got for you here is about a Linux utility called screen so I'm just going to go ahead and log in to uh that again on on something I've got a root shell on so if I go back to this ni I elevate you can AP install a program called screen now screen is super useful and I'll show you why if you just grab screen I've already got it of course but kill your server real quick and now what you've noticed is that while you're running your server this terminal window has to be open or the process will kill itself what you can do is run screen so if you do screen do/ start.sh it'll open it up and if you hit control if you hold down control press a release a and then press D and then release D what it'll actually do is detach so what I've just done is detach from the running process and come back to the shell and what I can do is at any time I can resume that with screen- r so what I can do is completely exit this shell entirely like I can just type exit exit exit close the connection but my server is still still running and I can come back to that uh I just Sue back to this one with the super secure password that I created that I actually can't even type for some reason um and I can just do screen- R and it'll bring me back to my game server which is really handy so yeah go ahead and do that now I will show you loading into the server just to show that it's all good one thing that you might have to consider before you do that though is your firewall so Counter Strike servers if you're on Debian so if you don't have a firewall on this machine at all you don't have to you can skip this section but I'll show you my uh firewall setup so whatever you pick for Counter Strike you have to forward both the TCP and the UDP port for that so here I've got 2717 forwarded and if you're using ufw it's literally ufw allow 27017 and you can hit enter and it'll do it for TCP and if you add/ UDP to the end it'll forward it for UDP so you want to do both of those but once you've allowed it on your firewall um you should be good to go so we'll load into Counter Strike and try and connect to this server so we're here in Counterstrike 2 if you open up the console uh if you don't have the developer console enabled by the way it is under um game so you can go to uh developer console and you want to enable the developer console right here so basically once you've done that open up the developer console and you can type connect and then the IP address of your server so in my case it is 192.168.1.2 n and then a colon apologies if you can't really see the text I can't make it bigger cuz it's the steam console but 2717 is my port so I can just go ahead and hit connect and it'll load me into the server so if you want to play funny Workshop Maps like this Minecraft one right here just go to the workshop page in your web browser and up here in the Steam Community URL where it says ID equals just go ahead and copy the number so you go ahead and do that and back in your server console real quick you can type down the bottom hostor Workshop unor map and then paste in the ID of the workshop map and for me it'll instantly swap over because I already have the map downloaded but for you it'll download the map in the background and then swap over to it as soon as the download is complete you can also download uh maps from steamcmd itself so if you go into steamcmd I might have to log back in real quick you can download them from here as well so it's Workshop downloador item the app ID of the game so 730 and then the the thingo the the ID of the thing so as you can see it's downloaded the map to our you know CS2 directory so you can go ahead and exit out of that and I'll boot up Counterstrike again do that right now cuz I've got it in this window so if we go to Counterstrike and we go ahead and connect back to our server you can see now we're loading into aimore Minecraft village and here we are in our beautiful Minecraft day power is even easier to get set up than Counter-Strike 2 so on our home directory here we can just go ahead and go back to our steam directory steam apps common pal server and if you look at this directory right here there's a file called pal server. SH now I have gone ahead and made a start script for this uh start.sh oops do slash and essentially this what this does is infinitely Loop the pal server because I had an instance where my 24 power 247 power World server went down because the connection dropped to steam in the middle of the night and that just crash the game for some reason so I've just got this cheeky little wild true Loop that'll just continuously restart the power World server if it's going bad but um for power world in your firewall and I'll go back to my uh user that has uh that has pseudo access the power world Port is 8211 so you want to forward 8211 um and I think that should be it but then again I have all of these other ports forwarded honestly I'll just say this right now there is so little documentation on what ports you actually need to forward in order to get this stuff to work so it's kind of just a shot in the dark the ones that I have forwarded for um power world are 8211 that seems to be the client Port that you connect to on TCP at least and then in my router I'll actually put a screenshot on screen of the ones I have Port forwarded to this server so you can see which ones I actually needed to port forward for power world Counter Strike all of all of that stuff because the documentation for this stuff is is actually kind of poor screen/ start.sh or if you don't want to do the infinite Loop you could just do pal server. sh of course if you make one of these remember to chamod it as executable um and it'll just start up and so power world should be started up and I will join you in the power World server we're over here in power world just go ahead and hit join multiplayer game and down the bottom here in this like custom connect bar is where you put in the IP address of your server so I'm going to say 1921 168 1.29 and the port 8211 again that's the default power port if you've changed it then go ahead and put in the custom one I entered a password so um you can set that up in the power world settings I'm not going to dive into the power world settings because there's documentation available for it I might make a followup video video if you're interested or like a short or something but essentially the password that I've just set for the server is Minecraft toot because I'm doing a Minecraft tutorial so if you go ahead and hit okay what you'll notice is that we are suddenly loading into power world which is fantastic now I already have a save game on this so it's not going to bring me to the selection screen but I just want to show you that we're loading into the game server all fine just uh give it a moment I mean I'm going to keep this going in live time with no Cuts so you can see that it's actually loading in and there's no smoke and mirrors but I currently have power on my hard drive and so loading in obviously takes a little while so we're here we are we're in power world on our custom dedicated server pretty cool if you don't put forward your servers none of your friends are going to be able to join them um now unfortunately I can't actually show you how to port for because every router is different that's the really unfortunate nature of port forwarding you'll want to be looking in your router for something titled either port forwarding gives the game away or virtual servers or something like that or address forwarding it'll be something like that and I'll again I'll show a screenshot of what it is for me but you could look at your router's model number and then port foring and search that on Google and hopefully someone out there will have done a tutorial or guide on it or if you're Savvy with computer networking I mean you're probably heavy enough if you're watching this video you can probably figure it out yourself but this video was essentially just a basic introduction to steam CMD and a couple of game server setups uh you could do this for any game server on Steam that has a Linux option available you just go ahead and download it with app update make the port available in your firewall and then run the game server on that it's pretty cool it's pretty fun and yeah a really great way to enjoy stuff with your friends like I said we host the 24/7 power World server for the mates and get on the custom Workshop maps on CS2 cuz on CS2 right now like hosting Workshop Maps the old way where you just like everyone joins a Lobby and you load into a work map that's been broken for a while so a custom Community server is the only way to actually do that and then again in my videos where I do Counter-Strike Source commentary on like software engineering Theory and things like that I can now do that on my own custom Counterstrike Source surf server and I I might actually do a follow-up video to this where I set up a ser server in particular cuz that's a kind of Niche topic there's like no documentation on it and uh it was a lot of fun it took me like you know I spent an afternoon and a night on it it was it was a lot of fun so yeah that's pretty much it for this one hope you guys enjoyed let me know what servers you're running and how you've enjoyed them with your friends I'd really love to hear about it
Info
Channel: hoff._world
Views: 1,484
Rating: undefined out of 5
Keywords: steam, steamcmd, gaming, servers, game server, dedicated game server, dedicated server, dedicated steam server, dedicated steam game server, linux, debian, ubuntu, linux server, linux steam server, linux game server, docker, port forwarding, firewalls, networking, server administration, counter-strike 2, cs2, counter-strike: 2, palworld, palworld server, palworld dedicated server, cs2 server, workshop maps, cs2 workshop maps, valve, community server, community, custom map, workshop, how to
Id: frp-bNoqjzc
Channel Id: undefined
Length: 27min 47sec (1667 seconds)
Published: Wed Feb 28 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.