Skip to content

Instantly share code, notes, and snippets.

@dunderrrrrr
Last active October 6, 2024 17:37
Show Gist options
  • Save dunderrrrrr/3cd1d4a1b39ac96bde52d26b5f7fe148 to your computer and use it in GitHub Desktop.
Save dunderrrrrr/3cd1d4a1b39ac96bde52d26b5f7fe148 to your computer and use it in GitHub Desktop.
CS2 server

CS2 server

Launch script

#/bin/bash

SERVER_DIR=$HOME/cs2-server

echo "⌛️ Updating CS2 server..."
steamcmd +login anonymous +force_install_dir $SERVER_DIR +app_update 730 +quit

echo "🛠️ Starting server..."
cd $SERVER_DIR/game/bin/linuxsteamrt64
./cs2 -ip 0.0.0.0 -port 27015 -dedicated +map de_dust2 -debug -usercon -console -secure -dev  +game_type 0 +game_mode 1 +sv_setsteamaccount XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +exec server.cfg

Basic server config (goes in /home/user/cs2-server/game/csgo/cfg/server.cfg)

echo ---------------------------
echo - Loading server settings -
echo ---------------------------

hostname "ServerName"           // 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 "p4ssw0rd"             // Protect your server with a password
rcon_password "rc0n_p4ssw0rd"       // 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 ---------------------------

Use rcon cli to changelevel etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment