Back to Blog

How to Make a CS2 Server, Step by Step

How to make a CS2 server with SteamCMD, step by step: Counter-Strike 2 dedicated server setup, GSLT token, game modes, server.cfg, ports and plugins.

Nodesty Team7 min readGame servers
The words CS2 Server with SteamCMD, GSLT and 27015 on a dark Nodesty background

Making a CS2 server comes down to four steps: you download the free Counter-Strike 2 server files with SteamCMD, get a server token (GSLT) from Steam, start the server with a command that sets the game mode and map, and open port 27015. The core steps are the same whether you want private matches with friends, a community server or a retake server with plugins.

This guide walks through every step of setting up a CS2 dedicated server on Linux, from requirements and SteamCMD to launch parameters, server.cfg settings, ports and plugins.

Requirements

  • Operating system: The CS2 dedicated server runs on 64-bit Linux and Windows. This guide uses Ubuntu and Debian; Linux uses fewer resources and is better suited to running 24/7.
  • CPU: The CS2 server's main loop runs largely on a single core. High clock speed matters more than core count.
  • RAM: 4 GB is a comfortable start for a 10-player match server. For busy community servers with plugins, go for 8 GB.
  • Disk: The server files are large and grow with every update. We recommend at least 60 GB of free space; NVMe storage speeds up map changes and updates.
  • Steam account: Not needed to download the server files, but to create a GSLT you need a Steam account that owns CS2 and has a verified phone number.

All you need to know is how to connect to a server over SSH; we give every other command step by step.

Installing SteamCMD

SteamCMD is Valve's command-line tool for downloading game server files. For security, run the server as a separate user instead of root.

  1. Install the required library and create a user called steam:
    sudo apt update
    sudo apt install lib32gcc-s1 curl tmux
    sudo useradd -m -s /bin/bash steam
    sudo su - steam
    
  2. Download SteamCMD from Valve's official archive:
    mkdir ~/steamcmd && cd ~/steamcmd
    curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
    

Downloading the CS2 server files

Counter-Strike 2's Steam app ID is 730. To download the server files:

~/steamcmd/steamcmd.sh +force_install_dir /home/steam/cs2 +login anonymous +app_update 730 validate +quit

+force_install_dir must come before +login. Depending on your connection, the download takes anywhere from a few minutes to half an hour.

Once it finishes, create this link so the server can find the Steam client library; otherwise it fails at startup with a steamclient.so error:

mkdir -p ~/.steam/sdk64
ln -s ~/steamcmd/linux64/steamclient.so ~/.steam/sdk64/steamclient.so

Getting a GSLT (Game Server Login Token)

Valve requires internet-facing servers to run with a GSLT; a server without one doesn't appear in the server browser. To get a token:

  1. Go to steamcommunity.com/dev/managegameservers in your browser and sign in with your Steam account.
  2. Enter 730 as the App ID and a name you'll recognize as the Memo.
  3. Copy the generated token.

Use a separate token for each server and never share it. Valve can ban tokens of servers that break its server guidelines, which can also affect the account's ability to create new tokens.

Starting the server

The CS2 server executable lives in the game/bin/linuxsteamrt64 folder. Create a file called start.sh in the server folder:

#!/bin/sh
cd /home/steam/cs2/game/bin/linuxsteamrt64
./cs2 -dedicated -usercon -port 27015 -maxplayers 10 \
  +game_type 0 +game_mode 1 \
  +map de_dust2 \
  +sv_setsteamaccount YOUR_GSLT_TOKEN

Make it executable and start the server in a tmux session so it keeps running when you close your SSH connection:

chmod +x ~/cs2/start.sh
tmux new -s cs2 ~/cs2/start.sh

Press Ctrl + B and then D to detach; type tmux attach -t cs2 to return. When the console shows that it logged in with your GSLT and loaded the map, the server is ready.

Game modes

The game mode is selected by combining game_type and game_mode:

Modegame_typegame_mode
Casual00
Competitive01
Wingman02
Arms Race10
Deathmatch12

Basic settings with server.cfg

Server settings live in game/csgo/cfg/server.cfg and are read every time a map loads. Create the file if it doesn't exist:

hostname "Your server name"
sv_password ""
rcon_password "a-strong-password"
sv_lan 0
mp_autoteambalance 1
mp_limitteams 1
  • hostname: The name shown in the server browser.
  • sv_password: If set, players must enter this password to join. Handy for private matches with friends.
  • rcon_password: The remote administration password. Choose a long, unguessable one.
  • sv_lan: Must be 0; with 1, the server only accepts connections from the local network.

To change competitive match rules, create a file called gamemode_competitive_server.cfg and put settings such as mp_maxrounds, mp_roundtime or mp_freezetime there.

Ports and firewall

By default, a CS2 server uses port 27015:

  • 27015 UDP: Game traffic. Players connect on this port.
  • 27015 TCP: Remote administration via RCON.

If you use ufw on Ubuntu:

sudo ufw allow 27015/udp

Instead of opening RCON to everyone, allow only your own IP address. If you run a second server on the same machine, give it a different port such as -port 27016 and open that too. We explain how ports work and how to fix connection problems in What is a port?

Connecting to the server

In CS2, enable Settings → Game → Enable Developer Console, then open the console with the ~ key and type:

connect 203.0.113.10:27015

If you set a password, connect with connect 203.0.113.10:27015; password yourpassword. For admin tasks such as changing maps or kicking players, use the server console (tmux attach -t cs2), a tool that supports RCON, or the admin plugins described below.

Plugins: Metamod and CounterStrikeSharp

Features such as retakes, practice mode, 1v1 arenas or admin menus come from plugins. The most common setup in CS2 is:

  1. Metamod:Source 2.0: The base layer that loads plugins into the game. You extract its files into the game/csgo folder and add the line Game csgo/addons/metamod to the SearchPaths section of game/csgo/gameinfo.gi, below the Game_LowViolence line.
  2. CounterStrikeSharp: A framework for plugins written in C#. It installs on top of Metamod; plugins go in the addons/counterstrikesharp/plugins folder.

Important: every CS2 update overwrites gameinfo.gi. If plugins stop loading after an update, that line is the first thing to check. You may also need to install new versions of Metamod and CounterStrikeSharp after updates.

Updates and performance

Valve updates CS2 often, and players can't join an outdated server. The update routine is simple:

  1. Stop the server.
  2. Run the SteamCMD command again; only changed files are downloaded.
  3. If you use plugins, check the gameinfo.gi line.
  4. Start the server again.

To keep the server running smoothly:

  • Choose a CPU with high single-core speed. The most common cause of stutter in busy moments is the CPU not keeping up on a single core.
  • Choose a location close to your players. For players across Europe, Frankfurt keeps latency low. We explain what affects latency in What is ping?
  • Add plugins deliberately. Every plugin adds CPU load; remove the ones you don't use.
  • Don't skip DDoS protection. Competitive game servers are frequent attack targets.

Nodesty for your CS2 server

A CS2 server is easy to set up on a virtual server for anyone comfortable with Linux. Nodesty AMD Ryzen 9 9950X VPS plans meet CS2's CPU demands with single-core speeds of up to 5.7 GHz, and run in Frankfurt and New York with NVMe storage, L3–L7 nShield DDoS protection and free daily backups kept for 7 days. If you'd rather start with a ready-made server, take a look at our game server plans for games such as Minecraft, FiveM and Rust.

Counter-Strike 2 and Steam are trademarks of Valve Corporation. Nodesty is not affiliated with or endorsed by Valve.

Frequently Asked Questions

Does it cost anything to make a CS2 server?

No. The Counter-Strike 2 dedicated server software is free and downloads anonymously with SteamCMD. You only pay for the machine that keeps the server online 24/7. Players just need to own CS2 on Steam.

How much RAM does a CS2 server need?

A 10-player competitive match server usually uses 2–3 GB of RAM; with the operating system, 4 GB is a comfortable start. For community servers with plugins or several CS2 servers on one machine, go for 8 GB or more. Single-core CPU speed matters more than RAM in CS2.

What is a GSLT and do I need one?

A GSLT (Game Server Login Token) is a free key that links your server to your Steam account. Valve requires internet-facing servers to use one, and servers without a token don't appear in the server browser. You create it at steamcommunity.com/dev/managegameservers with app ID 730.

Can a CS2 server run at 128 tick?

No. CS2 uses Valve's sub-tick system instead of a configurable tick rate, and servers run at 64 tick. There is no 128-tick setting like in CS:GO, so there's no need to try to change the tick rate on your server.

Why can't players join after a game update?

When CS2 updates, players' clients and your server end up on different versions and connections are refused. Stop the server and run the SteamCMD command again to update it. If you use Metamod, re-add the Metamod line, because updates overwrite gameinfo.gi.

Can I host a CS2 server on Windows?

Yes. Download the same app ID 730 with the Windows version of SteamCMD and start the server with the same parameters using cs2.exe in the game\bin\win64 folder. Linux uses fewer resources and is better suited to running for long periods, so we recommend it for 24/7 servers.

Nodesty

About the author

Nodesty Team · Infrastructure & Support

The Nodesty team runs our servers, network and DDoS protection day to day and answers customer support requests around the clock. These guides come from that work.

Related articles

Launch your server now.

Build, scale, and conquer without limits on Nodesty's premium infrastructure.

                                                                                                                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                                             ············································                                                   
                                                ··································································································..........···························                                     
                                       ················..........................................................................................................................··············                             
                                  ·············.................::::::::::::::::::::::::::::::::::::::::::::::....................:::::::::::::::::::::::::::::::::::::::................···········                        
                             ············................:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::............·········                     
                         ············.................:::::::::::::::::::::::::::::::::::::::::::::::::::------------::::::::::::::::::::::::::::::----------------:::::::::::::::::::::..........········                  
                    ············......................::::::::::::::::::::::::::::::::::::------------------------------------------------------------------------------------:::::::::::::.........········                
                ··········.............................................::::::::::::::::::-------------==========================================-----------------------------------:::::::::::........·······               
             ········..................:.....................................::::::::::--------=======+++++++++++++++++++++++++++++++++++++=========================------------------::::::::::.......·······              
           ······.........::::::::::::::::::::................................:::::::-----=====++++xxxxxx**************************xxxxxxxxx++++++++++++++===================------------::::::::.......·······             
          ·····.......:::::::::::::::::::::::::::.............................:::::----===+++xxx****%%%%&&&&&&#############&&&&&&&%%%%%*******xxxxxxxx++++++++++++++==============----------:::::::......······             
         ····......::::::::-------------:::::::::::..........................::::---===+++xx***%%%&&&####@@@@@@@@@@@@@@@@@@@@@@@@####&&&&&%%%%*******xxxxxxxxx+++++++++++++===========--------::::::......·····             
        ····.....:::::::--------------------:::::::::.......................::::---===++xxx**%%&&&###@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###&&&&%%%%%********xxxxxxxxxxx++++++++++++========------::::::.....······            
        ····.....:::::--------------------------::::::::....................::::---===++xx***%%&&&####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###&&&&&%%%%%**********xxxxxxxxxxxxx+++++++++=======------:::::.....·····            
        ····....::::::-------=============---------:::::::::................:::::---===+++xx***%%%&&&#####@@@@@@@@@@@@@@@@@@@@@@@@@#####&&&&&%%%%%%*************xxxxxxxxxxxxxx+++++++++======-----:::::....·····            
         ····....:::::-------================---------:::::::::...............:::::----===++++xxx***%%%%&&&&&&#################&&&&&&%%%%%%%*******************xxxxxxxxxxxxxxxxx++++++++======----:::::....·····            
         ·····....:::::--------=================---------::::::::::..............:::::::-----====+++++xxxxxx**************************xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx++++++++=====-----::::....·····            
          ·····.....:::::--------=================----------:::::::::::.................:::::::::-------=============++++++++++++++++++++++++++++++++++++xxxxxxxxxxxxxxxxxxxxxxx++++++++======-----::::....·····            
            ·····.....:::::::----------===========-------------::::::::::::.........................::::::::::::::::::------------------=============+++++++++++++++++++++++++++++++++=======-----::::.....·····            
              ······......:::::::---------------------------------:::::::::::::........................................:::::::::::::::-----------============+++++++++++++++++++++========------:::::.....·····             
                 ······........:::::::::---------------------------:::::::::::::::::...........................................:::::::::::::------------=============================--------::::::.....······              
                    ·········.........:::::::::::::::-------------::::::::::::::::::::::::.......................................::::::::::::::::--------------------------------------::::::::......·······                
                          ··········............::::::::::::::::::::::::::::::::::::::::::::::::::................................::::::::::::::::::::::::::-------------:::::::::::::::.........········                   
                                  ············..................:::::::::::::::::::::::::::::::::::::::::::.........................:::::::::::::::::::::::::::::::::::::................···········                        
                                             ················.............................................................................................................·················                                 
                                                           ······················................................................................···························                                                
                                                                               ·········································································