Create CS:GO Server on Linux VPS
Creating a Counter-Strike: Global Offensive Server on a Linux server is not a big deal.
On Linux it only takes a little more than a handful of steps. Each of these steps is pretty simple. This step by step guide is mainly for people who have never done something of this kind before.
Step 1:
Create a new user, assign a password to the user and a directory. In this example I work with the user ‘csgo’.
Then you need to enter some commands:
1. With the first command we created a new user:
useradd csgo
2. With the second command we gave the new user a password:
passwd csgo pass pass
3. The third command is to created a new directory
mkdir /home/csgo
4. and the fourth assigns this directory to the new user:
chown -R server /home/csgo
Step 2:
Log in with the created user, create a directory for the game server and download the HLDSUpdateTool. The latter is necessary to install the game server.
Here are the further commands in order to proceed:
With the first command we log out with root and log in with server:
su server
The second command creates the directory “srcds”:
mkdir srcds
The third command changes to the created directory:
cd srcds
The fourth command downloads the SteamCMD:
wget htttp://blog.counter-strike.net/wp-content/uploads//2012/04/steamcmd.tar.gz
The fifth command unpacks the downloaded file:
tar xfvz steamcmd.tar.gz
Step 3: Start SteamCMD
with command:
./steamcmd.sh
Now all required files will be installed. Then you are in the Steam window where you can log in.
Step 4: Login
The login is also possible anonymously. The command for this is:
login anonymous
If you use SteamCMD to manage other players who need a login, please use your login data.
login username password
As login data you have to enter your STEAM login data! If you have SteamGuard active, you will get an error message in the console as well as a mail from Valve with the Guard code.
You need to enter the code as follows:
set_steam_guard_code CODE-AUS-DER-MAIL
Then use the Login command again.
Step 5: Download the Game Server
Now that you have successfully logged in, you can download the game server.
First we have to specify the directory where the game server should be loaded.
This works with the following command:
force_install_dir .\csgo-server\
.\ indicates that the server will be installed in the same directory as SteamCMD. If you want a higher folder, you would have to specify ..\csgo-server\. Of course you can also specify an absolute path.
If a directory was specified, you can start the download. That goes with it:
app_update 740 validate
This command starts the download of the server.
You could also execute step 5 – the server download – with this shortcut – all in one line:
./steamcmd.sh +login anonymous +force_install_dir ../csgo_server/ +app_update 740 validate +quit
If the download is at 100%, the server is downloaded and you can continue with step 6.
Step 6: Server Test
(If you just want to check if the server really starts :))
./srcds_run -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_bomb +map de_dust
Step 7: Use screen
Use screen so the server doesn’t stop when you stop putty
screen -A -m -d -S csgo_server ./srcds -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_bomb +map de_dust