Create your CS2 Dedicated Server – Full Guide
Why the process is different
The process is only a little different from CS:GO’s dedicated server. Instead of downloading a seperate branch made specifically for hosting servers, at the time of CS2’s release: We need to use the same branch as the main release. There isn’t a dedicated server branch (740) like there was for CS:GO.
Downloading CS2 Dedicated Server
Currently there isn’t a “Dedicated Server” branch for CS2 like there was for CS:GO (App ID 740 instead of 730 [The game’s ID]).
There are 2 ways to get the game’s files:
Download CS2 on Steam. Then Right-Click the game, and under the Manage seubmenu select Browse local files. This should take you to where the game is installed. You should find cs2.exe in
Alternatively use SteamCMD to get the game’s files. Again this isn’t the dedicated server, it’s the game’s files so there’s no need to do this unless you need the files disconnected from your game (for modifications) or because you’re on a VPS or another device.
Download SteamCMD for Windows here.
Extract into a folder where you’ll install the server to in a folder called steamcmd. You don’t need to, but I’ll have this seperated from the game files to keep everything clean. For example:
Open a Command Prompt in the folder with steamcmd.exe by clicking the path at the top of your Windows Explorer and typing cmd. Otherwise open a command prompt/terminal and use cd
Download CS2 into a folder called server, located at
steamcmd.exe +force_install_dir ../server/ +login
Remember to replace
You may need to surround your password in quotes for it to work properly („).
You may need to enter your Steam Guard Mobile Authenticator code if you have your account protected. You should need to do this as Steam Guard is a GOOD IDEA!
Once complete you should see CS2.exe in
Make note of the path to CS2 for either installation method and create a server.bat file to launch our server. In here we can set up a name and more.
Server ID
Now we need to get a server ID to allow our server to appear on the public server list (once everything is set up by Valve. I don’t think this works just yet).
You don’t technically need a “sv_setsteamaccount” but this should make sure complete compatability with friends over the internet, and even adding it to the server browser when that’s working.
Not to mention currently it seems server IDs invalidate themselves shortly after creation. Maybe Valve is planning something different for CS2?
Head to the Manage Game Servers section on Steam.
Enter 730 in the App ID section at the bottom
Enter a name like CS2 server to the Memo section.
Click Create.
Copy the new ID on the list and make note of this. We will use this to replace
You should use another account regardless as launching the server may kick you offline on Steam. If this happens, create another
Creating server config & launch files
Create a server.bat file by creating a new Text Document, renaming it to server.bat and removing .txt. If you don’t see .txt then make sure you enable File Extensions in Windows Explorer under the View tab.
If you downloaded using SteamCMD, place this file in
Enter the following and save the bat file:
If you used SteamCMD:
steamcmd\\steamcmd.exe +force_install_dir ../server/ +login
cd server\\game\\bin\\win64
start /wait cs2.exe -dedicated -usercon -console -secure -dev +game_type 0 +game_mode 1 +sv_logfile 1 -serverlogging +sv_setsteamaccount
Once again enter your username and password. Same as above. If you get an error about your password, consider surrounding it in quotes („)
If you are using your existing CS2 files in SteamApps:
cd „
start /wait cs2.exe -dedicated -usercon -console -secure -dev +game_type 0 +game_mode 1 +sv_logfile 1 -serverlogging +sv_setsteamaccount
Replace
Don’t forget to replace
Again: You don’t technically need a “sv_setsteamaccount” but this should make sure complete compatability with friends over the internet, and even adding it to the server browser when that’s working.
Some other options to consider:
Consider including -ip
You can also change -secure to -insecure to disable anti-cheat (Already added above).
+sv_autobunnyhopping 1 to enable BHopping by holding jump
+exec server.cfg – (Already added above) Assuming you created a server.cfg file with options you’d like your server to use.
Steam CMD note:
When launching the server.bat file for Steam CMD it should update the server making sure it will work online with the most up-to-date clients. You may be asked for your Steam Guard code. If so, you may want to create another account until the official CS2 Dedicated Server is released.
Creating a server.cfg
You can enter a TON of commands such as air strafe speed and more inside a server.cfg file that executes when your server starts.
If you’ve made an autoexec.cfg before, then it’s the same method.
For Steam: Create a server.cfg file by renaming an empty .txt file in
For SteamCMD: Create a server.cfg file by renaming an empty .txt file in
If you find some options aren’t setting once the server opens: Simply run exec server in your server’s console window once it’s running.
server.cfg
echo —————————
echo – Loading server settings –
echo —————————
hostname „TroubleChute’s Test Server“ // Server name
sv_lan „0“ // Show online
sv_region „255“ // Set region (255 is worldwide)
// Performance
sv_maxrate „0“ // Max bandwidth rate allowed on server, 0 == unlimited
sv_minrate „0“ // Min bandwidth rate allowed on server, 0 == unlimited
sv_parallel_sendsnapshot „1“ // Enables multi-threading.
sv_clockcorrection_msecs „15“ // The server tries to keep each players m_nTickBase withing this many msecs of the server absolute tickcount
sv_hibernate_when_empty „0“ // Puts the server into extremely low CPU usage mode when no clients connected
// FUN:
// sv_accelerate „5.15“ // Used to increase max speed
// sv_airaccelerate „12“ // Used to increase strafe speed
// sv_cheats false // Allow clients to use cheat commands
// host_timescale „1“ // Change the speed of time on your server.
// sv_autobunnyhopping „1“ // Enable bhopping
// ADMIN:
// sv_password „pass“ // Protect your server with a password
// rcon_password „asdf1234password“ // Allow users to run RCON console commands. Do not enable unless you know what you’re doing.
// sv_downloadurl „http://fastdl.server.com/csgo“ // Server FastDL (Should not end with a /) – If you have a FastDL server
echo —————————
echo – Done loading server.cfg –
echo —————————
The echo commands at the start and end make it easy to see if your config was run sucessfully.
Joining your new CS2 server
Simply open the console in-game and run connect 127.0.0.1:27015 or you should see your server on te LAN tab of the server browser.
Letting others join your new CS2 server
This is simpler said than done. There are 2 sections and both need to be done to let friends over the internet play.
Open the server to LAN (Others on your local network)
To let someone on the same local network (router) as you play: You need to allow the CS2 server through your firewall.
We need to open ports 27015 and 27016. If you set a custom port above, then forward that.
If you’re using a third-party antivirus with a firewall; you’ll need to look into how to open the ports.
If you’re using Windows Firewall (by default) then run the following commands in an Administrator Powershell window.
Powershell
New-NetFirewallRule -DisplayName „CS2 Server“ -Direction Inbound -LocalPort 27015,27016 -Protocol TCP -Action Allow
New-NetFirewallRule -DisplayName „CS2 Server“ -Direction Inbound -LocalPort 27015,27016 -Protocol UDP -Action Allow
New-NetFirewallRule -DisplayName „CS2 Server“ -Direction Outbound -LocalPort 27015,27016 -Protocol TCP -Action Allow
New-NetFirewallRule -DisplayName „CS2 Server“ -Direction Outbound -LocalPort 27015,27016 -Protocol UDP -Action Allow
This will open both of the ports and allow people on the same local network as you to connect to your server while it’s running.
All you need is your local IP address (Other devices on your network may be able to see you in the LAN tab of the server browser as well).
To get your local IP:
Run the following in a terminal/CMD/powershell window: ipconfig
Find the way you’re connected to the internet, for example Ethernet adapter Ethernet
Find the IPv4 address and copy it
For example, your local IP is 192.168.1.10
Other devices can use this local IP address to connect to your server. Note: This is a LOCAL IP, and your server is not yet accessible over the internet or even routers outside of your own… That’s where we need to
Port Forward
Using your Local IP address we found above (and allowed ports through to) – We need to send traffic from these two ports to our computer.
If you’re using multiple routers in a chain before your computer reaches your fiber box/access box: You’ll need to port forward each router to the next until you finally port forward to your computer.
Port forwarding varies wildly from router to router, and you can look up guides specifically for your router. Essentially you’ll need to forward ports 27015 and 27016 on both TCP and UDP to your computer (or the next router on the way to your computer).
On most routers you can enter a range such as 27015-27016, or enter them comma-seperated such as 27015,27016, and even select TCP/UDP instead of needing to create a rule for each type.
Let’s say you have just ONE router between you and the internet (Example: You’re connected directly to the fiber box), you’ll port forward as follows:
Ports: 27015,27016
Type: TCP/UDP
Destination: 192.168.1.10
Now you’re done port forwarding.
Letting others join
At this point you’ve allowed local traffic and over the internet to reach your CS2 server. All you need to do is let others join by checking the Server Browser in-game, or by getting your external IP address by Google searching “What is my IP”.
Others can then use the console to connect using connect xxx.xxx.xxx.xxx:27015.
Have fun!
editor's pick
latest video
news via inbox
Nulla turp dis cursus. Integer liberos euismod pretium faucibua