Steam’s official game servers for Counter-Strike: Global Offensive are good enough for most purposes. However, you don’t control them. If you create your own server, you will be able to:
- Set your own rules, such as match time, freeze time, max players, friendly fire, and so on. But watch to be sure you don’t break important rules, especially these.
- Have private matches with your friends.
- Organize contests/tournaments.
- Play on custom maps.
Why Create a Game Server on Linux?
Some of you might be thinking, “Wouldn’t this be easier on Windows, on my own computer even?” Well, first of all, if you host a game on your home computer, that’s usually good enough only for local network games. Most Internet service providers offer decent download quality but not so good for uploads. The server is laggy, jittery, and offers an inconsistent gameplay experience. It’s better to rent a server from a reputable cloud computing provider if you want smooth games.
While most cloud services let you host Windows as the operating system, this is not ideal either. Windows consumes a lot of RAM that you could be using to host your game instead. This leads to increased cost. You also have to pay for a per-hour license, which increases the cost even more. And last but not least, the steps to configure the game server (srcds daemon) itself are pretty much the same on Windows and Linux. This means that it’s not any easier to do this on Microsoft’s operating system than on Linux.
Here’s an example of a Debian system using only 56.7MB of RAM.
Game Server Requirements
CS:GO game servers are not very demanding, so virtual private servers will do just fine (no need for dedicated). The minimum requirements:
- 2GB of RAM.
- Two virtual cores/CPUs. “Intensive compute” instances might be more responsive. Try normal compute first, then upgrade to intensive if you notice server lag.
- At least 40GB of storage space.
- Debian as the operating system. You might use other distros, too, if you really want to, but Debian will give you a headache-free experience. Instructions in this article are Debian-specific.
- If your VPS provider lets you configure a firewall through their web interface control panel, disable it for this instance.
- Configure your instance to use SSH key-based authentication preferably. If you intend to use a password, use a very good one! Most of the time servers are broken into because of weak or very weak passwords. SSH key-based authentication prevents this.
- If you don’t already have a Steam account, create one here.
Upgrade and Reboot Instance
Once you have set up your instance, log in as root via SSH. If your provider only allows you to log in as a regular user with sudo privileges, enter this after you log in.
Make sure all packages are up to date.
Reboot in case important software has to be reloaded (kernel, systemd init process, etc.).
Log back in as root (or as the regular user, and become root with
sudo -i if necessary).
Enable 32-bit support.
Install the following package:
Enable installation of closed-source, non-free software packages.
Refresh package manager information.
Press TAB to select “OK” in the first prompt, then select “I AGREE” in the next prompt with the license agreement, otherwise the install will abort.
Install byobu, which you will use to keep the CS:GO server process running even after you quit your SSH session.
Install CS:GO Dedicated Server
Running this under the root account is a bad idea, so create a regular user first, which will run the dedicated server daemon.
Log in as this user.
Instruct the steamcmd utility to install all required files in the “CSGO” directory.
This will take a while as game files are a download greater than 20GB+. If the process gets interrupted, just run the above command again (after you log back in as root and then log in as the “cstrike” user with
su - cstrike). It will continue where it left off.
While the download is in progress, you can register the required Game Server Login Token. Go to Steam’s game server account management page. Scroll down to the following contents.
Use “730” as the App ID. As for the Memo, you can type in anything you want. A code will be generated which you will need in a future command. See the Login Token example in the next picture.
Launch CS:GO Dedicated Server
Enable byobu to autolaunch when user “cstrike” logs in.
Start a byobu session.
Bug notice: on Windows’ SSH client, the string “1;0c” may appear on the command line. Delete the string if this happens before you continue.
Start Counter-Strike: Global Offensive server daemon process. The next command is an example: you will have to replace the GSLT at the end in
+sv_setsteamaccount B382BB13C7AAAFDE8272247F87586106. Delete the string starting with “B382,” and add your own game login token you generated in the previous step.
-net_port_try 1 and
+sv_setsteamaccount are both required command parameters. The rest of the parameters you can change according to your needs. For info on how to start various game modes, such as Deathmatch or Arms Race, consult this wiki page.
Press F6 to detach from the byobu session and leave the server running. Or, press Ctrl + C to close the server.
When you reconnect later as root to your server, to restore the byobu session, just log back in as the “cstrike” user.
If the session doesn’t open automatically, type:
Start Game and Connect to Server
Upon a successful server start, you will see a message like this in the terminal:
Copy the IP address.
Launch Counter-Strike: Global Offensive on your computer.
In the top-left corner, click on the drop-down list where it says “OFFICIAL MATCHMAKING.”
Select “Community Server Browser.” Click on the “Favorites” tab, then in the bottom-right corner click on “Add a Server.”
Paste the public IP of your VPS. Click “Refresh” if the game server doesn’t appear in the list. Double click on the entry to join.
Congratulations on creating your CS:GO game server. You will have to configure your game according to you and your friends’ preferences. The page linked earlier can be a good start to learning command line options for the srcds game daemon and how to configure “autoexec.cfg” and “server.cfg” to adjust game settings. Have fun!