Egg Repository

Pterodactyl Community Egg Repository

Counter-Strike 2

For over two decades, Counter-Strike has offered an elite competitive experience, one shaped by millions of players from across the globe. And now the next chapter in the CS story is about to begin. This is Counter-Strike 2.

Read Me

Counter-Strike 2

Steam Description : For over two decades, Counter-Strike has offered an elite competitive experience, one shaped by millions of players from across the globe. And now the next chapter in the CS story is about to begin. This is Counter-Strike 2.

Install notes

For CS2 Valve has decided to merge the game and server files. There will not be standalone dedicated server files.

Installation/System Requirements

Minimum Recommended
Processor minim x86-64-v2 (with popcnt) ---
RAM 2 GB ---
Storage 33 GB ---

Server Ports

Ports required to run the server in a table format.

Port default
Game 27015
Source TV (Optional) 27020

RCON

RCON is only accessible from external apps, NOT from the game client itself. It's broken in CS2. If possible always use the Pterodactyl console to use your commands like map de_nuke or mp_restartgame 3.

Notes

Further install instructions can be found at the official Documentation.

Yolks
NameTag
ghcr.io/ptero-eggs/steamcmd:sniperghcr.io/ptero-eggs/steamcmd:sniper
Variables
NameDescriptionEnvironment VariableDefault ValueUser ViewableUser Editable
MapThe default map for the server. Examples: Bomb: de_dust2, de_mirage, de_nuke, de_overpass, de_inferno, de_ancient, de_vertigo, de_anubis Hostage: cs_italy, cs_office Arms Race: ar_baggage, ar_shootsSRCDS_MAPde_dust2YesYes
Source AppIDRequired for game to update on server restart. Do not modify this.SRCDS_APPID730NoNo
Max PlayersSpecifies the maximum amount of players that are able to join the server.MAX_PLAYERS12YesYes
Auto-update serverThis is to enable / disable auto-updating your server on restart. By default this is set to enabled.AUTO_UPDATE1YesYes
SourceTV PortSourceTV port used for connections to spectates games on your server.TV_PORT27020YesNo
Steam Gameserver Login TokenThe Steam Account Token required for the server to be displayed public. The token can be acquired here: https://steamcommunity.com/dev/managegameserversSTEAM_GSLTYesYes
Enable VACEnable / Disable VAC (Valve Anti Cheat) on your server. By default this will be enabled.VAC_ENABLED1YesYes
Enable RCONEnable / Disable RCON for using RCON commands with external tools. By default this will be disabled.RCON_ENABLED0YesYes
Server NameSets the server name listed in the steam server browser.SERVER_NAMEA Pterodactyl hosted CS2 ServerYesYes
Server PasswordIf specified, players must provide this password to join the server.SERVER_PASSWORDYesYes
RCON PasswordTo gain access to administrator commands on the server.RCON_PASSWORDYesYes
GamemodeDefines the Gamemode and Gametype to be set at the start of the next round. Examples: Competitive: game_mode 1 game_type 0 Wingman: game_mode 2 game_type 0 Casual: game_mode 0 game_type 0 Deathmatch: game_mode 2 game_type 1 Arms Race: game_mode 0 game_type 1 Custom: game_mode 0 game_type 3GAME_MODE1YesYes
GametypeDefines the Gamemode and Gametype to be set at the start of the next round. Examples: Competitive: game_mode 1 game_type 0 Wingman: game_mode 2 game_type 0 Casual: game_mode 0 game_type 0 Deathmatch: game_mode 2 game_type 1 Arms Race: game_mode 0 game_type 1 Custom: game_mode 0 game_type 3GAME_TYPE0YesYes
Install Script
#!/bin/bash
# steamcmd Base Installation Script
#
# Server Files: /mnt/server
# Image to install with is 'ghcr.io/ptero-eggs/installers:debian'

## just in case someone removed the defaults.
if [[ "${STEAM_USER}" == "" ]] || [[ "${STEAM_PASS}" == "" ]]; then
    echo -e "steam user is not set.\n"
    echo -e "Using anonymous user.\n"
    STEAM_USER=anonymous
    STEAM_PASS=""
    STEAM_AUTH=""
else
    echo -e "user set to ${STEAM_USER}"
fi

## download and install steamcmd
cd /tmp
mkdir -p /mnt/server/steamcmd
curl -sSL -o steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
mkdir -p /mnt/server/steamapps # Fix steamcmd disk write error when this folder is missing
cd /mnt/server/steamcmd

# SteamCMD fails otherwise for some reason, even running as root.
# This is changed at the end of the install process anyways.
chown -R root:root /mnt
export HOME=/mnt/server

## Install game using steamcmd
./steamcmd.sh +force_install_dir /mnt/server +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +app_update ${SRCDS_APPID} ${EXTRA_FLAGS} validate +quit ## other flags may be needed depending on install. looking at you cs 1.6

## set up 32 bit libraries
mkdir -p /mnt/server/.steam/sdk32
cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so

## set up 64 bit libraries
mkdir -p /mnt/server/.steam/sdk64
cp -v linux64/steamclient.so ../.steam/sdk64/steamclient.so

## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"