Run a dedicated server
A game that runs by itself, so your team can join it and it keeps going when you leave.
It's more work than it sounds. If you're practising on your own, a game of your own is all you need.
What you need
- A computer that stays on
- Yours, or one you rent. Spawners doesn't host servers.
- Room for it
- The download is about 60 GB. Valve's wiki lists at least 2 GB of memory and 65 GB of disk. Hetzner's tutorial asks for more for a full server: 4 cores, 8 GB of memory and 80 GB of disk.
- A Steam account that can make a token
- It has to have CS2 and a registered phone number, and can't be limited, locked or community banned.
- A way in
- Players reach the server on a port, which you may have to open. Step 3 says which one.
1. Get a token from Steam
A token is what lets your server show itself to Steam, so players can join over the internet. Open Steam's page for game server tokens, sign in, enter
730as the game's number, and press Create. Note the long code it gives you.Keep it to yourself, like a password, and use one token for each server.
2. Download the server
SteamCMD is Valve's tool for downloading servers. It fetches the server as app
730, the same number as the game.On Windows
Make a folder such as
C:\steamcmd, unzip steamcmd.zip into it, open a command prompt there, and run:steamcmd.exe +force_install_dir C:\cs2-server +login anonymous +app_update 730 validate +quitValve's wiki says Steam itself has to be installed on the computer too, or the server won't start.
On Linux
These are for Ubuntu. Don't run the server as root. If a rented server only gives you root, make a normal user first:
adduser steam usermod -aG sudo steam su - steamThen download it, and say yes to Steam's licence when you're asked:
sudo add-apt-repository multiverse sudo dpkg --add-architecture i386 sudo apt update sudo apt install lib32gcc-s1 steamcmd steamcmd +force_install_dir ~/cs2-server +login anonymous +app_update 730 validate +quitThen make the link the server looks for when it starts:
mkdir -p ~/.steam/sdk64 ln -sf ~/.local/share/Steam/steamcmd/linux64/steamclient.so ~/.steam/sdk64/steamclient.so3. Open the port
Players come in on port
27015, over UDP. On a rented server, open it in the company's firewall if it has one. At home, allow it in the computer's firewall and forward it to that computer in your router's settings. On Linux with the firewall ufw turned on, that'ssudo ufw allow 27015/udp.4. Start it
Choose what you want, paste your token, and copy the line.
It stays in this browser: nothing you type here is sent anywhere.
The lines to run
First go to the server's folder. If you installed it somewhere else, change the start of this:
cd C:\cs2-server\game\bin\win64Then start it:
.\cs2.exe -dedicated +sv_setsteamaccount YOUR_TOKEN +game_type 0 +game_mode 1 +map de_mirageOn a rented Linux server
The server stops when you close your connection to it, so start it inside screen, a program that keeps it going:
sudo apt install screen screen -S cs2Run the lines above in there. Press
Ctrl+Aand thenDto leave it running, and typescreen -r cs2to get back to its console.5. Join it
Open the console in CS2 and type
connect 203.0.113.10:27015, with your server's address in place of those numbers. Until a password is set, anyone with the address can join: set up a scrim to add one.
If it doesn't work
- Nobody can join after a CS2 update
- The server has to match the game. Run the download from step 2 again, then start it again.
- The server runs, but nobody can reach it
- Check step 3. From outside your home, the address to use is your router's public one, not one that starts with 192.168. Some internet providers share one public address between many homes, and then forwarding can't work: a rented computer gets round that.
- The download won't log in
- Some guides say it needs a real account. Replace
anonymouswith your Steam name, and enter your password and code when you're asked. - The token stopped working
- Steam lets a token expire if it goes unused for a long time, and replaces all of yours if your password is reset. Get the new one from the same page.
- On Linux, it stops when you log out
- Start it inside screen, as step 4 says.
- On Linux, it stops with a message about steamclient.so
- Make the link at the end of step 2 again.
Valve can change any of this in an update, so where a step doesn't match, trust Valve's page. These steps rest on Steam's page for game server tokens, Valve's wiki on CS2 dedicated servers, Hetzner's community tutorial and the server guide on csdb.gg.