Skip to content

Instantly share code, notes, and snippets.

@fanjin-z
Last active September 22, 2024 01:27
Show Gist options
  • Save fanjin-z/d25b8cd71609f25aa07b824bb463a254 to your computer and use it in GitHub Desktop.
Save fanjin-z/d25b8cd71609f25aa07b824bb463a254 to your computer and use it in GitHub Desktop.
Complete Guide for Hosting CS:GO Dedicated Servers

Complete Guide for Hosting a CS:GO Dedicated Server

Creative Commons License.

I tested the setup on Debian Stretch (naive installation) and Jessie (LinuxGSM installation). The setup should work on Debian 8 (Jessie), Debian 9 (Stretch) and Ubuntu (16.04). However, If you're running on Windows or other non-debian based Linux OS (e.g. CentOS, openSUSE), this guide doesn't apply to you.

My Servers:

I'm hosting FFA warm-up and HvH(soon) servers in San Francisco, welcome to join by:

IPv4: 159.89.154.137   
Ipv6: 2604:a880:2:d0::20ad:2001    
Domain: fjzeng.org

Test server delay (RTT)

ping -c 4 138.68.252.208    # on Linux
ping -n 4 138.68.252.208    # on Windows

To keep your server safe, it's always recommended to enable both private key and password login authentication. (Guide: Setup SSH Authentication , Enable both authentication)

Install CS:GO Dedicated Server

Naive Installation (Not Recommended)

Create an user account name steam (or whatever name you like). You will be prompted to create a password.

adduser steam

Give your created account sudo privilege.

adduser steam sudo

Switch to your account.

su - steam

Go to your home directory.

cd /home/steam

Create a directory for SteamCMD and switch to it.

mkdir ~/Steam && cd ~/Steam

Install dependency library.

sudo apt-get install lib32gcc1 && sudo apt-get install lib32stdc++6

Download and extract SteamCMD.

curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -

Run SteamCMD and updates will automatically be download. If success, Steam> prompts.

~/Steam/steamcmd.sh

Login your steam account. Your will be required to enter your steam password (, and Two-factor code if Steam Guard is enabled).

login [Steam Username]

Designate install path for csgo server.

force_install_dir /path/to/csgo-ds/

Login as anonymous.

login anonymous

Install csgo dedicated server. This step takes quite a while, approx. 17 GB space will be used.

app_update 740 validate

When installation completes, quit SteamCmd.

quit

Start a casual game on dust 2 (see note). More script info Source Dedicated Server.

/path/to/csgo-ds/srcds_run -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount [token]

Open CS:GO game and connect to your server. On CS:GO game console.

connect IP[:PORT]

or Search your server on community server pages PLAY > BROWSE COMMUNITY SERVERS. HF.

Note: To host public servers, you need Steam Game Server Login Token (GSLT). Register on Steam Game Server Account Management.

Installation with LinuxGSM (Highly Recommended)

Complete LinuxGSM official guide

Create an user account name csgoserver (or whatever name you like). You will be prompted to create a password.

adduser csgoserver

Give your created account sudo privilege.

adduser csgoserver sudo

Switch to your account.

su - csgoserver

Go to your home directory.

cd /home/csgoserver

Register Steam Game Server Login Token (GSLT) on Steam Game Server Account Management.

Install dependencies (Debian 64 bits). (Note: dependencies are slightly vary for different OS, please check here )

sudo dpkg --add-architecture i386; sudo apt update; sudo apt install mailutils postfix curl wget file bzip2 gzip unzip bsdmainutils python util-linux ca-certificates binutils bc tmux lib32gcc1 libstdc++6 libstdc++6:i386

Download and run the script.

wget https://linuxgsm.com/dl/linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh csgoserver

Run the installer and follow the instructions.

./csgoserver install

Start the server.

./csgoserver start

Open CS:GO game and connect to your server. On CS:GO game console.

connect IP[:PORT]

or Search your server on community server pages PLAY > BROWSE COMMUNITY SERVERS. HF.

More on server management

Setup admin

Download Source Mod Download Metamode: Source Download Metamode vdf. (Note: select game Counter-Strike: Global Offensive)

Untar (or unzip) sourcemod and sourcemm to same folder.

tar -xzvf sourcemod-xxx.tar.gz -C /target/directory
tar -xzvf mmsource-xxx.tar.gz  -C /target/directory

Replace with newly downloaded metamod.vdf

cp /download/directory/metamod.vdf /target/directory/addons

Add yourself to admin. Append your SteamID and privilege to /target/directory/addons/sourcemod/configs/admins_simple.ini in following format.

"STEAM_0:1:16"		"z"

Your can find your steamID By Steam ID Finder. "z" represents root privilege. More privilege info in admin_levels.cfg of the same folder.

Upload everything under /target/directory to server csgo directory. (If install with LinuxGSM, the path is ~/serverfiles/csgo)

scp -r /target/directory csgoserver@[Server IP]:~/serverfiles/csgo

Start the server and connect to the server in-game. Toggle admin by enter !admin on game chat or enter say "!admin" on console.

Further Reading

CS:GO Dedicated Server Guide – How To Setup and Install [link]. This article provides excellent explanation on major configuration files (e.g. gamemodes_server.txt, server.cfg).
Linux GSM: Developing LGSM [link]. This article explains how LinuxGSM works.
Linux GSM: Workshop(https://github.com/GameServerManagers/LinuxGSM/wiki/Workshop)].
Deathmatch Goes Advanced [link]. An excellent plugin for Deathmatch server.

Reference: Valve developer wiki: SteamCMD.
Valve developer wiki: Counter-Strike: Global Offensive Dedicated Servers.
Linux GSM: Getting Started with csgoserver.
Linux GSM: Multiple Game Servers.
How to set up Admin (sourcemod) on a CS:GO Dedicated Server [YouTube link].

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

@strund3r
Copy link

Thanks for this tutorial!

The "Download and run the script" step has changed:

wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh csgoserver

@sunsetnothing
Copy link

sunsetnothing commented Nov 10, 2023

why are you giving sudo privileges to the users you're running with and allowing key and password authentication? please do some further reading before recommending insecure practices to the public.

@JeremiahK96
Copy link

JeremiahK96 commented Nov 11, 2023

why are you giving sudo privileges to the users you're running with and allowing key and password authentication? please do some further reading before recommending insecure practices to the public.

I agree, this user should NOT have sudo privileges. In fact, I don't think there is anything in this guide that even needs sudo privileges, other than the installation of dependencies, which should be done with a privileged user anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment