This topic has been locked
Is there a Linux Dedicated Server Guide for 2021
I'm new to Linux and decided to setup a CSGO server on an old laptop running Ubuntu Server 20.04.

I had a hard time finding a current guide on how to setup a server. I got it up and running through trial and error, trying different things from outdated articles and YouTube. It was quite frustrating. Are there any current guides or resources that can help me? I'm talking basics, server install, command lines, best practices, etc.

I found the Steam WIKI lacking or at times outdated. Many articles tell you do something without explaining what it is OR it assumes prior knowledge. I also noticed the server spits out errors that seem to be normal, but who knows!

Thanks
< >
Showing 1-11 of 11 comments
[N]ebsun 6 Dec, 2021 @ 1:41pm 
https://developer.valvesoftware.com/wiki/SteamCMD#Linux
https://developer.valvesoftware.com/wiki/Source_Dedicated_Server
https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Games

This is not quite updated, but gives a good overview of things to check
https://wiki.alliedmods.net/Srcds_hardening#Crashes

I am sure there are a few guides on steam.

The most basic steps are:
1. Install SteamCMD
2. Use SteamCMD to download the required dedicated server files (SRCDS)
3. Configure the dedicated server
4. Test and run
Last edited by [N]ebsun; 6 Dec, 2021 @ 1:43pm
[sbf] rabab 6 Dec, 2021 @ 2:33pm 
Thank you! I hit all these pages. It just wasn't as straightforward as I was expecting given how long this has been around.

I find the commands to be confusing as in when and how to use them. For example, should it be in the command line when I start the server, command line when the server is already up or console when in the server as a client.
Metal_Warrior 7 Dec, 2021 @ 8:19am 
If you're new to Linux, you probably don't want to host a server on the internet. Take that from a prof. Linux System Engineer.

That being said:
I've written a script to install CS:S. It can be modified to do the same for CS:GO, alas that is probably not that easy. But the comments and commands within should at least give you a rough overview on how to do it, e. g. creating a dedicated user, implement security and so on.
You may find that at https://github.com/M3tal-Warrior/installers/tree/master/cssource
[sbf] rabab 7 Dec, 2021 @ 10:55am 
Originally posted by Metal_Warrior:
If you're new to Linux, you probably don't want to host a server on the internet. Take that from a prof. Linux System Engineer.

That being said:
I've written a script to install CS:S. It can be modified to do the same for CS:GO, alas that is probably not that easy. But the comments and commands within should at least give you a rough overview on how to do it, e. g. creating a dedicated user, implement security and so on.
You may find that at https://github.com/M3tal-Warrior/installers/tree/master/cssource

Thanks! What are things I need to watch out for if I'm hosting on internet? What's the safer way to learn how to host using Linux? Thanks
Metal_Warrior 7 Dec, 2021 @ 12:40pm 
That actually is a good question, as there are a plethora of things people frequently do wrong. Most of the howtos you'll find are a security nightmare. It's a profession for a reason, not a hobby (alas I've started out with Linux as a hobby).

Let's see:
1. Never run anything as root/sudo unless you're dead sure there's no other way.
2. Never run anything as root that is a web service. Exceptions are limited to sshd and VERY few other things you'll never get your hands on within the next 10 years or so.
3. Services are only run by system users. No exceptions.
4. System users must not be able to write to any file on the disk, except cache/temp directory (/tmp/servicename), their own data/home directory (/var/lib/servicename) and logs (/var/log/servicename/*). Especially the binaries are to be owned by root exclusively!
5. Never install other repositories than the one of your OS, unless there's no other way (read: there almost always is)
6. Always prefer the provided packages of your OS to anything you'll find on the internet, even if the latter promises newer versions. Stick to your OS toolkit, that one gets security updates.
7. You want to install unattended-upgrades. That one keeps your system up to date.
8. Rule of thumb for privileges of services in general: The fewer the better. As many as exactly necessary, as few as possible.
9. You want to read the FHS 3.0. You'll understand a lot about your system if you've read that.
10. Wikis to trust: Ubuntuusers Wiki, Debian Wiki, Arch Wiki. The latter has the deepest dive into the weeds, the middle one is the mother of Ubuntu. For servers you'll probably want to switch to Debian, it has less ♥♥♥♥ flying around and safer default options for services.
11. The 'man' command is your friend.
12. 99% of developers don't know ♥♥♥♥ about running services. Don't use their howtos.

That probably is a good list to start with.

I'm afraid running a steam server is not easy to do properly (I've done that a lot with my apprentices for training purposes), as it's not prepackaged by the OS maintainers and needs a lot of manual work to be secure. Most howtos tell you 'run steamcmd as root and afterwards start the binary as root, easy', which is just plain wrong (see #1 and #2). If you take a look at my installer, it tries to avoid that as far as possible and changes the owner of almost everything to root. It basically is the result of the better part of a work week of a very eager apprentice, and we've had a deep dive into kernel calls and such.
If you really want to learn Linux without being a security risk for yourself and others, try a webserver/nextcloud with letsencrypt. It's fairly easy and you'll learn a lot. And don't get discouraged. If you succeed and have fun with it, you're able to get into one of the best paying professions around - even without attending university. But beware: It's a profession that never sleeps, so learning until you die will be like 50% of your time (but you will get paid for that).
Last edited by Metal_Warrior; 7 Dec, 2021 @ 12:47pm
[sbf] rabab 7 Dec, 2021 @ 2:29pm 
Thanks for your response! Very helpful. I think I managed to keep to most of your suggestions. I have openVPN, openSSH and ftp running. Used default repository, etc. Separate user for steam. UFW enabled.

This is more of a hobby for me. Already have a career in Finance but have somewhat of a technical background. Linux has always been something I wanted to learn. I just had 1gbit symmetrical service installed and want to host games from home lol.

I'm going to restart with a fresh copy of everything and go through your list once I get my hands on an Optiplex with better hardware.
Last edited by [sbf] rabab; 7 Dec, 2021 @ 2:44pm
Metal_Warrior 7 Dec, 2021 @ 2:59pm 
You don't want FTP. It's old, not encrypted, and a ♥♥♥♥♥♥ protocol. I found rsync, https and ssh the better options (depending on what to transfer to whom).
Also I'd strongly advise against hosting stuff at home, at least for a newbie. If your home server gets pwned, you can't trust anything in your network any longer. I'd advise for buying a vserver somewhere for a couple of bucks and host the games there - if it gets pwned, you've lost a game server, no big deal. Also regarding hardware lifetime it's a better investment to put your money into hosting, as a datacenter has better infrastructure (cooling, UPS, redundancy, security monitoring) than you're able to provide to a home server.
[sbf] rabab 7 Dec, 2021 @ 4:16pm 
Thanks! I used ftp just to read only and make finding folders and files easier/faster when I was troubleshooting.

I looked into a VPS and will probably try that out when I get comfortable with what I'm doing. Could I separate the home server from my other devices? Vlan?
Metal_Warrior 8 Dec, 2021 @ 8:33am 
You want to install VMs on your home system? That is (regarding ressources) a bad idea, as the overhead will eat a lot of CPU/RAM away without any boon whatsoever. Separating services with users and systemd is the low cost option that I find having almost no disadvantages.

Yes, VLANs is an option alas most routers can't do them and if you're not familiar with networking you'll probably end up with less security than just leaving it be.
Don't overdo it. Small steps, learn the OS basics so you're able to blindly find your stuff on the console, and then go to network and firewalling. There's a lot of things to know not to mess up.

Like I said - leave gameservers outside and your private stuff inside is the way better option for a beginner, as most home routers offer more security than you're able to set up yourself for quite some time.
Last edited by Metal_Warrior; 8 Dec, 2021 @ 8:35am
[sbf] rabab 30 Dec, 2021 @ 1:49pm 
I meant Virtual Private Server. However, I did install Proxmox and have a few VMs running including one for CSGO on a Dell OptiPlex. I'm also using VLANs to further secure the services I am running and my private network. I'm feeling more confident in what I am doing now and will likely setup a VPS somewhere soon. Thanks for all your suggestions!
Annie 25 May, 2022 @ 10:35am 
This thread is no longer constructive and has therefore been locked. Thanks for your understanding.
< >
Showing 1-11 of 11 comments
Per page: 1530 50