How to host your own Counter Strike Global Offensive Server?
Run your own gaming server on Ubuntu 18.04
Using a Linode Server.
[ Create a Linode and Account ]
- Create a Linode running Ubuntu 18.04.
- Create a Steam account if you do not have one, and download Counter Strike: Global Offensive to your computer.
- A Steam game server login token (GSLT) is required to host a public CS:GO server. Without the token, client connections are restricted to the LAN only. Register your GSLT on Steam’s website. Enter
730
as the App ID when creating your GSLT. Review Steam’s documentation for more information about GSLTs.
- Complete our guide: Install SteamCMD for a Steam Game Server. This will get SteamCMD installed and running on your Linode and this guide will pick up where the SteamCMD page leaves off.
[ Prerequisites ]
After following the SteamCMD guide, some firewall modifications are needed specifically for CS:GO:
- Stop the SteamCMD process if it is currently running.
Replace a firewall rule to slightly extend the UDP port range available to the game. This command assumes that you have only the iptables rules in place from the SteamCMD guide:
sudo iptables -R INPUT 5 -p udp -m udp --dport 26900:27030 -j ACCEPT
Reconfigure iptables-persistent to ensure that your new rule persists:
sudo dpkg-reconfigure iptables-persistent
[ Install Counter Strike ]
- 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 can take some time. If the download looks as if it has frozen, be patient. Once the download is complete, you should see this output:
Success! App '740' fully installed. Steam>
Exit SteamCMD:
quit
[ Configure the Server ]
Create a file called server.cfg
using your preferred text editor with the contents of the following snippet. The location you should save this file to depends on how you installed SteamCMD:
SteamCMD Installation MethodFile Location
Package manager ~/.steam/steamcmd/csgo-ds/csgo/cfg/server.cfg
Manual installation ~/Steam/csgo-ds/csgo/cfg/server.cfg
The value for hostname
will displayed to users that join your server. Replace the values of sv_password
and rcon_password
with two different and unique passwords that you don’t use elsewhere.
File: server.cfg
hostname "The name of your CS:GO server"
sv_password "server_password"
sv_timeout 60
rcon_password "rcon_password"
mp_autoteambalance 1
mp_limitteams 1
writeid
writeip
sv_password
is the password users will need to enter to join the server. rcon_password
is the RCON password, which is used to remotely control the game server from within the game.
For an extensive list of server.cfg
options, see this page.
Create a startup script for CS:GO with the following snippet. Name the file startcsgo.sh
and save it to your steam
user’s home directory. Set the value of the YOUR_GSLT
variable at the top to be your game server login token. Set the value of the CSGO_INSTALL_LOCATION
variable at the top according to the table below.
File: ~/startcsgo.sh
#!/bin/sh
YOUR_GSLT=
CSGO_INSTALL_LOCATION=
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
SteamCMD Installation Method CSGO_INSTALL_LOCATION
Package manager ~/.steam/steamcmd/csgo-ds/
Manual installation ~/Steam/csgo-ds/
When run, the script will execute a Dust2 server in competitive game mode in a screen session. For more startup modes and game options, see Valve’s CS:GO wiki.
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 yoursteam
user’s home directory.
cd ~ && ./startcsgo.sh
Review instructions for detaching from or stopping SteamCMD to exit the CS:GO server.
[ Join the Game ]
- Launch Counter-Strike: Global Offensive.
- Once launched, go to Play and click Browse Community Servers.
- Click on the Favourites tab and then click Add a Server at the bottom.
- Type in the IP address of your Linode and click Add this address to favourites.
- You’ll see your new Counter-Strike: Global Offensive server. Click Connect at the bottom right and start fragging away.