Game Servers – CSGO

Counter Strike: Global Offensive was released by Value and it’s your basic everyday multiplayer 5v5. The game was released around 2012 and it’s still popular till this day. Having a very active player count, it’s community based servers is still one of the selling points of CSGO. Having fun with players on unofficial matches and game modes such as zombies, or other modes meant for trainings such as 1v1s. Surprisingly most popular server owners do make a stable income for their servers, using donations and perks as a money magnet, if you know the right spots to hit, who knows, maybe one day your server will kick off.

Counter-Strike: Global Offensive is a multiplayer first-person shooter video game developed by Valve and Hidden Path Entertainment. It is the fourth game in the Counter-Strike series and was released for Windows, OS X, Xbox 360, and PlayStation 3 in August 2012, while the Linux version was released in 2014

Wikipedia

Hosting – VPS

First, you need to find a host which sells Ubuntu Virtual Private Servers. This is often easy to find, but it’s difficult finding the one which the right balance of price and support / usability. For our tutorial, we will be assuming you will be using a host which already does the pre-setup for the user. We will also provide VPS services that we recommend.

Server Space

Pricing
Updated on 26/10/2020

We have used Server Space before, and had a great experience using them. Their prices are cheap and flexible. However, the support may not be as quick as other services. We also have no downtimes with their services and overall had a great experience with them.

Creating The Server

Server Space allows users to create servers within 2 click, follow along

Click on create then create server

After clicking on create, they offer a few options, however, we will stick to these options

Make sure to select the ubuntu 18.04 x64

After creating a server, they should redirect you to their control panel. This step if really up to you, but you can choose to either use PuTTY or use their own web console. i Would recommend using Putty, since it’s easier to copy and paste commands and overall it’s much faster.

Pre-Requirements

Since the game is much bigger than the other game servers we have covered, there are some things you need to make sure you have. This tutorial is also for an x64 machine

  • Disk Size – The overall server size will be around 20 GB. I would recommend getting a VM that has more than 50GB, just in-case you want to add your own addons or other extensions. For CPU and RAM, it really depends on how popular your server is, for starters 2 Cores with 1 GB RAM would do it, however, if you like to increase this number, feel free to overtime.
  • Steam Account – This comes without saying, but please make sure you have a steam account, as you will be using it for the server. I think there are other requirements to obtaining a login token such as phone steam guard, but i am unsure if this applies to everyone.

There is also a requirement on registering for a game server token, ensure that your steam account meets the following requirements

SteamCMD

As usual, we will be installing all the server files and folders in our home folder. You can change this if you like, firstly let us create a folder in our home for the files.

mkdir /home/server/steamcmd
mkdir /home/server/csgo/
cd /home/server/steamcmd

Since we will be installing CSGO game files which is not in the default repositories on Ubuntu, let us install multiverse

software-properties-common
add-apt-repository multiverse

Since SteamCMD is a 32bit program, we will be needing to enable 32bit support

dpkg --add-architecture i386
apt update

Once we have created a folder for it, let us download SteamCMD. Note that there are two ways of doing this as noted in the official wiki, we will cover only the package method as this should work for almost everyone

sudo apt install steamcmd

We will then link the steamcmd ececutable

ln -s /home/server/steamcmd steamcmd

Server Files

Once the SteamCMD package has been installed, we will be not be using root to run the server but another non-privileged user for best practice. Therefore, let us add a user and login into it

sudo adduser --disabled-login --no-create-home --gecos csgo csgo
su - csgo

Once you have logged into the non-privileged account, we will than be installing the CSGO files

steamcmd +force_install_dir /home/server/csgo/ +login anonymous +app_update 740 validate +quit

This may take a while depending on how fast the network speed is, usually this can take 5 mins to an hour. Once the download has been completed, you should see this as an output

Success! App '740' fully installed.

Once the installation is done, you can update the game in the future by running the following command

steamcmd +force_install_dir /home/server/csgo/ +login anonymous +app_update 740 +quit

Running Server

For this step, you need to generate your own game server token, this ensures that you don’t need to type in your username and password when launching the server. This is also used to allow Steam to moderate the community servers by value. Please read up on the community rules and ensure you are not breaking any guidelines.

Next, let us install screen. Screen basically allows us to detach from terminal sessions while leaving that session running. So we can create a session for our CSGO server while still being able to use the terminal. This makes life much easier, as without screen, when you exit your terminal, the game server will go down with it. Install screen with the following command

sudo apt install screen

Once you have installed screen, make sure to type Y and ENTER, if it asks to install additional packages.

After Installing screen, you can now launch CSGO in a terminal then detach from it, making it run as a different process.

cd /home/server/csgo
screen -S csgo srcds_run -game csgo -net_port_try 1 +game_type 0 +game_mode 0 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount B38F6E71E4FA3BD74BE08354AF5BE025

The output should display your server’s public IP address which you can then use to connect to it. You can either use the CSGO’s console connect cmd or direct connect using the server browser.

You can detach the terminal session by doing Control + A then D, You can then re-enter the terminal session by doing. You can quit or force end the server anything by pressing Control + C.

screen -R csgo

Configuration

If you like to run commands each time before the server launches, you can do so by creating a autoexec.cfg, make sure you create this file in /csgo/cfg, if not it will not work.

autoexec.cfg

This is only ran ONCE, therefore only add commands which you want to run once. Here is an example of a autoexec config


log on //This is set to turn on logging! Don't put this in your server.cfg 
hostname "Counter-Strike: Global Offensive Dedicated Server" 
rcon_password "yourrconpassword" 
sv_password "" //Only set this if you intend to have a private server! 
sv_cheats 0 //This should always be set, so you know it's not on 
sv_lan 0 //This should always be set, so you know it's not on 
exec banned_user.cfg 
exec banned_ip.cfg

server.cfg

This config is ran every map change, so add commands you want to run every time a game ends and switches to a new map. Here is an example of a server.cfg config

mp_autoteambalance 1 
mp_limitteams 1 
writeid 
writeip

Leave a Reply