How to create CS: GO Server on Linux VPS

The official Steam server game for Counter-Strike: Global Offensive is suitable for most purposes. However, you cannot control them.

The official Steam server game for Counter-Strike: Global Offensive is suitable for most purposes. However, you cannot control them. If you create your own server, you will be able to:

  1. Set your own rules, such as match time, freezing time, maximum players, etc. But make sure you don't break important rules.
  2. There are private matches with friends.
  3. Organize competitions / tournaments.
  4. Play on a custom map.

Instructions for creating CS: GO Server on Linux VPS

  1. Why create game server on Linux?
  2. Requirements on game server
  3. Upgrade and restart the game server
  4. Install steamcmd
  5. Install CS: GO dedicated server
  6. Register GSLT
  7. Launch the CS: GO dedicated server
  8. Start the game and connect to the server

Why create game server on Linux?

Some of you might think, is it simpler to create a game server on a Windows computer? First, if you host a game on your home computer, that is usually only enough for local network games. Most Internet service providers offer decent download quality but not very good for uploading. The server lagged, jerked and provided an inconsistent gaming experience. It is better to hire a server from a reputable cloud provider if you want to play games smoothly.

Although most cloud services allow you to host Windows as an operating system, this is not ideal either. Windows consumes a lot of RAM that you might be using to host your game instead. This results in increased costs. You also have to pay for a license every hour, making the cost increase further. Last but not least, steps to configure game server (srcds daemon) are quite similar on both Windows and Linux. This means that doing this on Microsoft's operating system is not easier on Linux.

Below, an example of a Debian system uses only 56.7MB of RAM.

Picture 1 of How to create CS: GO Server on Linux VPS

Requirements on game server

CS: GO server games do not require much, so virtual private servers will work well (no need for dedicated servers). The minimum requirements include:

  1. 2GB RAM.
  2. Two virtual cores / CPU. The Intensive compute (computer specialized in processing) can respond faster. Try the normal computer first, then upgrade to a computer that specializes in processing, if the server is laggy.
  3. At least 40GB of storage.
  4. Using the Debian operating system. You can also use other distributions, if you really want to, but Debian will give you the easiest experience. The instructions in this article are exclusively for Debian.
  5. If your VPS provider allows you to configure the firewall through the web interface control panel, disable it in this case.
  6. Configure your server to use the best SSH-based authentication. If you intend to use a password, use a strong password! Most time servers are attacked by using weak or very weak passwords. Authentication based on SSH key will prevent this.
  7. If you don't have a Steam account, create an account here.

You can get affordable and reliable VPS at Linode or DigitalOcean.

Upgrade and restart the game server

Once you have set up your game server, log in as root via SSH. If your provider only allows you to log in as a regular user with sudo privileges, enter this information after you log in.

 sudo -i #ONLY ENTER THIS IF YOU ARE NOT ALREADY ROOT! 

Make sure all packages are up to date.

 apt update && apt upgrade 

Restart in case the important software has to be reloaded (kernel, systemd boot process, etc.).

 systemctl reboot 

Log back in as root (or as a normal user and become root with sudo -i if necessary).

Install steamcmd

Activate 32-bit support:

 dpkg --add-architecture i386 

Install the following package:

 apt install software-properties-common 

Allows installation of closed source software packages, not free.

 add-apt-repository contrib add-apt-repository non-free 

Refresh package manager information:

 apt update 

Install steamcmd:

 apt install steamcmd 

Picture 2 of How to create CS: GO Server on Linux VPS

Press TAB to select 'OK' in the first prompt, then select 'I AGREE' in the next prompt with the license agreement, otherwise the installation will cancel.

Byobu installation, which you will use to maintain the CS: GO server process works even after you exit the SSH session.

 apt install byobu 

Install CS: GO dedicated server

Running a CS: GO dedicated server in the root account is a bad idea, so create a regular user account first, to run a dedicated server daemon.

 adduser --gecos "" --disabled-login cstrike 

Log in as the user just created.

 su - cstrike 

The steamcmd utility guide installs all necessary files in the 'CSGO' folder .

 steamcmd +force_install_dir ~/CSGO/ +login anonymous +app_update 740 validate +quit 

This will take a while because the game files are usually very large, about 20GB. If the process is interrupted, simply rerun the above command (after you log back in as root and then log on as a cstrike user with su - cstrike ).

Register GSLT

While the download process is in progress, you can register the Game Server Login Token. Go to Steam's server game account management page. Scroll down to the following.

Picture 3 of How to create CS: GO Server on Linux VPS

Using App ID is 730. For Memo, you can enter anything you want. A code will be created for you to use with future commands. See the Login Token example in the next figure.

Picture 4 of How to create CS: GO Server on Linux VPS

Launch the CS: GO dedicated server

Allow byobu to automatically turn on when users 'cstrike' log in:

 byobu-enable 

Start a byobu session:

 byobu 

Error message : On Windows SSH client, the string '1; 0c' may appear on the command line. Delete the string if this happens before you continue.

Counter-Strike : Global Offensive: The next command is an example: You will have to replace the GSLT at the end of + sv_setsteamaccount B382BB13C7AAAFDE8272247F87586106. Delete the string starting with 'B382' and add the login token to the game you created in the previous step.

 ~/CSGO/srcds_run -game csgo -net_port_try 1 +game_type 0 +game_mode 0 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount B382BB13C7AAAFDE8272247F87586106 

-net_port_try 1 and + sv_setsteamaccount are mandatory command parameters. The remaining parameters can be changed according to needs. For information on how to start different game modes, such as Deathmatch or Arms Race, refer to this wiki page:

 https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server 

Press F6 to separate from the byobu session and let the server run. Or, press Ctrl + C to close the server.

When you reconnect later with root access to your server, to restore the byobu session, simply log back in as a 'cstrike' user .

 su - cstrike 

If the session does not open automatically, type:

 byobu 

Start the game and connect to the server

When the server starts, you will see a message like this in the terminal:

 Connection to Steam servers successful. Public IP is 203.0.113.8 

Copy IP address.

Launch Counter-Strike: Global Offensive on your computer.

In the upper left corner, click the drop-down list marked 'OFFICIAL MATCHMAKING'.

Picture 5 of How to create CS: GO Server on Linux VPS

Select 'Community Server Browser' . Click on the Favorites tab , then in the lower right corner, click 'Add a Server' .

Picture 6 of How to create CS: GO Server on Linux VPS

Paste VPS's public IP. Click 'Refresh' if the game server does not appear in the list. Double click on the item to connect to the server.

Congratulations! You have successfully created your CS: GO server game. Next, you will have to configure the game according to your preferences and your friends.

Hope you are succesful.

Update 07 August 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile