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

MinimumRecommended
Processorminim x86-64-v2 (with popcnt)---
RAM2 GB---
Storage33 GB---

Server Ports

Ports required to run the server in a table format.

Portdefault
Game27015
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 and Startup

Startup Command

LD_LIBRARY_PATH="$HOME/game/bin/linuxsteamrt64:$LD_LIBRARY_PATH" ./game/bin/linuxsteamrt64/cs2 -dedicated $( [ "$VAC_ENABLED" == "1" ] || printf %s ' -insecure' ) -ip 0.0.0.0 -port {{SERVER_PORT}} -tv_port {{TV_PORT}} -maxplayers {{MAX_PLAYERS}} $( [ "$RCON_ENABLED" == "0" ] || printf %s ' -usercon' ) +game_mode {{GAME_MODE}} +game_type {{GAME_TYPE}} +map {{SRCDS_MAP}} +hostname "{{SERVER_NAME}}" +sv_password "{{SERVER_PASSWORD}}" +rcon_password "{{RCON_PASSWORD}}" +sv_setsteamaccount {{STEAM_GSLT}}

Variables

Map

The 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_shoots

Environment Variable: SRCDS_MAP
Default Value: de_dust2
User Viewable:
User Editable:
Source AppID

Required for game to update on server restart. Do not modify this.

Environment Variable: SRCDS_APPID
Default Value: 730
User Viewable:
User Editable:
Max Players

Specifies the maximum amount of players that are able to join the server.

Environment Variable: MAX_PLAYERS
Default Value: 12
User Viewable:
User Editable:
Auto-update server

This is to enable / disable auto-updating your server on restart. By default this is set to enabled.

Environment Variable: AUTO_UPDATE
Default Value: 1
User Viewable:
User Editable:
SourceTV Port

SourceTV port used for connections to spectates games on your server.

Environment Variable: TV_PORT
Default Value: 27020
User Viewable:
User Editable:
Steam Gameserver Login Token

The Steam Account Token required for the server to be displayed public. The token can be acquired here: https://steamcommunity.com/dev/managegameservers

Environment Variable: STEAM_GSLT
Default Value:
User Viewable:
User Editable:
Enable VAC

Enable / Disable VAC (Valve Anti Cheat) on your server. By default this will be enabled.

Environment Variable: VAC_ENABLED
Default Value: 1
User Viewable:
User Editable:
Enable RCON

Enable / Disable RCON for using RCON commands with external tools. By default this will be disabled.

Environment Variable: RCON_ENABLED
Default Value: 0
User Viewable:
User Editable:
Server Name

Sets the server name listed in the steam server browser.

Environment Variable: SERVER_NAME
Default Value: A Pterodactyl hosted CS2 Server
User Viewable:
User Editable:
Server Password

If specified, players must provide this password to join the server.

Environment Variable: SERVER_PASSWORD
Default Value:
User Viewable:
User Editable:
RCON Password

To gain access to administrator commands on the server.

Environment Variable: RCON_PASSWORD
Default Value:
User Viewable:
User Editable:
Gamemode

Defines 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 3

Environment Variable: GAME_MODE
Default Value: 1
User Viewable:
User Editable:
Gametype

Defines 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 3

Environment Variable: GAME_TYPE
Default Value: 0
User Viewable:
User Editable:
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 "-----------------------------------------"
Installation Imageghcr.io/ptero-eggs/installers:debianInstallation Entrypointbash