How to setup a dedicated server for Counter-Strike: Global offensive
Publisher: Psychz Networks, February 25,2021An extended version of one of the all-time favorite and most popular team-based shooter games, Counter-Strike: Global Offensive (CS: GO) is the fourth game in the Counter-Strike series. Two teams compete in multiple rounds of objective-based game modes to win enough competitions to win the match.
The following article showcases steps on how to create and deploy Counter-Strike: Global Offensive.
- Updating Ubuntu libraries
- Installing Screen
- Install SteamCMD
- Run SteamCMD
- Install Counter Strike: Global Offense
- Configure the Server
- Start the Server
- Join the Game
Update Ubuntu
We will start with updating Ubuntu 18 for any latest file updates and patches
# sudo apt update
# sudo apt upgrade
Installing Screen
GNU Screen is a tool that works with a terminal session to allow users to resume a session after being disconnected. Screen prevents a session from "timing out" or disconnecting SSH connections or local terminal emulators.
# apt-get update
# apt-get upgrade
# apt-get install screen
Install SteamCMD
SteamCMD is a command-line version of the Steam client that works with games that use SteamPipe.
Since Steam is compiled for i386, you need to install the appropriate libraries if your Linux OS is built on 64-bit architecture instead of 32.
# sudo apt-get install lib32gcc1
Create the directory for SteamCMD and change to it:
# mkdir ~/Steam && cd ~/Steam
Download the SteamCMD install file:
Extract the installation and runtime files:
# tar -xvzf steamcmd_linux.tar.gz
Run SteamCMD
# screen ~/Steam/steamcmd.sh
Output
[----] Extracting package...
[----] Extracting package...
[----] Extracting package..
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching...
Redirecting stderr to '/root/Steam/logs/stderr.txt'
/tmp/dumps insufficient permissions - delete and recreate
[ 0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...OK.
Steam>
Exit SteamCMD
Press Ctrl + Shift + a followed by Ctrl + Shit + d to detach from the screen session without disrupting the steam process. To return to the screen session type.
# screen -r
Stop SteamCMD
To stop the Steam process and remove your screen session, enter quit at the Steam> command prompt or enter Control + C on your keyboard.
Install Counter-Strike: Global Offense
Run SteamCMD and login to Steam inside a screen session. From the SteamCMD prompt, install CS:GO to the steam user’s home directory:
# force_install_dir ./csgo-ds
# app_update 740 validate
This will usually take more than 30 mins to unpack and install all the files on your server. Once done, you can see the following output.
Output
Update state (0x61) downloading, progress: 100.00 (27902102795 / 27902102795)
Success! App' 740' fully installed.
Steam>
Exit SteamCMD:
# quit
Configure the Server
Create a file called server.cfg with the contents of the following snippet. Save the file in the following location.
The value for hostname will be displayed to users that join your server. Use appropriate passwords for sv_password and rcon_password. The sv_password is the password users will need to enter to join the server. rcon_password is the RCON password used to control the game server from within the game remotely.
# vi server.cfg
Copy the content below to the file
sv_password "************"
sv_timeout 60
rcon_password "************"
mp_autoteambalance 1
mp_limitteams 1
writeid
writeip
Now let us create a startup script for CS: GO with the following snippet.
Note: YOUR_GSLT variable at the top is your game server login token.
# vi startcsgo.sh
Copy following content to the file
YOUR_GSLT=77777777
CSGO_INSTALL_LOCATION= /Steam/csgo-ds/
cd $CSGO_INSTALL_LOCATION
screen -S "Counter-Strike: Global Offensive Server" ./srcds_run -game csgo -usercon +game_type 0 +game_mode 1 +mapgroup mg_bomb +map de_dust2 +sv_setsteamaccount $YOUR_GSLT -net_port_try 1
Make the script executable:
# chmod +x startcsgo.sh
Start the Server
Now that your server is installed and configured, it can be launched by running the startcsgo.sh script from your steam user's home directory.
# ./startcsgo.sh
Join the Game
On your local machine, launch Counter-Strike: Global Offensive.
Once launched, go to Play and click Browse Community Servers.
Click on the Favorites tab and then click Add a Server at the bottom.
Here you need to type in your server's IP address where you have just installed CS: GO and click Add this address to favorites.
You'll see your new Counter-Strike: Global Offensive server. Double click on the link or select and click Connect at the bottom right to connect to the server.
Congratulation! You have now successfully installed Counter Strike: Global Offensive on your Ubuntu 18 server. We hope you have found this guide helpful. Please click on the up-vote button to show your appreciation.