{"id":13928891,"url":"https://github.com/CM2Walki/CS2","last_synced_at":"2025-07-19T10:32:11.733Z","repository":{"id":198354606,"uuid":"700554030","full_name":"CM2Walki/CS2","owner":"CM2Walki","description":"This is a mirror of https://github.com/joedwards32/CS2. If you want to contribute, please open issues and PRs there.","archived":false,"fork":true,"pushed_at":"2024-08-29T20:50:11.000Z","size":143,"stargazers_count":57,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-08-29T23:08:55.993Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cm2.network","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"joedwards32/CS2","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CM2Walki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"CM2Walki"}},"created_at":"2023-10-04T20:08:11.000Z","updated_at":"2024-08-29T20:50:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a64328c-b7b8-4c60-8edf-b294b5a3a43b","html_url":"https://github.com/CM2Walki/CS2","commit_stats":null,"previous_names":["cm2walki/cs2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CM2Walki%2FCS2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CM2Walki%2FCS2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CM2Walki%2FCS2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CM2Walki%2FCS2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CM2Walki","download_url":"https://codeload.github.com/CM2Walki/CS2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226588859,"owners_count":17655798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-07T18:01:58.592Z","updated_at":"2024-11-26T17:31:06.961Z","avatar_url":"https://github.com/CM2Walki.png","language":"Shell","funding_links":["https://github.com/sponsors/CM2Walki"],"categories":["others"],"sub_categories":[],"readme":"[![Docker Image CI](https://github.com/joedwards32/CS2/actions/workflows/docker-image.yml/badge.svg?branch=main)](https://github.com/joedwards32/CS2/actions/workflows/docker-image.yml) [![Docker Build and Publish](https://github.com/joedwards32/CS2/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/joedwards32/CS2/actions/workflows/docker-publish.yml)\n\n# What is Counter-Strike 2?\nFor 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. \nThis Docker image contains the dedicated server of the game.\n\n\u003e  [CS2](https://store.steampowered.com/app/730/CounterStrike_2/)\n\n\u003cimg src=\"https://cdn.cloudflare.steamstatic.com/steam/apps/730/header.jpg?t=1696011820\" alt=\"logo\" width=\"300\"/\u003e\u003c/img\u003e\n\n# How to use this image\n## Hosting a simple game server\n\nRunning using Docker:\n```console\n$ SRCDS_TOKEN=\"...\" # check https://steamcommunity.com/dev/managegameservers\n$ docker run -d --name=cs2 -e SRCDS_TOKEN=\"$SRCDS_TOKEN\" -p 27015:27015/tcp -p 27015:27015/udp -p 27020:27020/udp joedwards32/cs2\n```\n\nRunning using a bind mount for data persistence on container recreation:\n```console\n$ mkdir -p $(pwd)/cs2-data\n$ chown 1000:1000 $(pwd)/cs2-data # Makes sure the directory is writeable by the unprivileged container user with uid 1000, known as steam\n$ SRCDS_TOKEN=\"...\" # check https://steamcommunity.com/dev/managegameservers\n$ docker run -d --name=cs2 -e SRCDS_TOKEN=\"$SRCDS_TOKEN\" -v $(pwd)/cs2-data:/home/steam/cs2-dedicated/ -p 27015:27015/tcp -p 27015:27015/udp -p 27020:27020/udp joedwards32/cs2\n```\n\nor using docker-compose, see [examples](https://github.com/joedwards32/CS2/blob/main/examples/docker-compose.yml):\n```console\n# Remember to update passwords and SRCDS_TOKEN in your compose file\n$ docker compose --file examples/docker-compose.yml up -d cs2-server\n```\n\nYou must have at least **40GB** of free disk space! See [System Requirements](./#system-requirements).\n\n**The container will automatically update the game on startup, so if there is a game update just restart the container.**\n\n# Configuration\n\n## System Requirements\n\nMinimum system requirements are:\n\n* 2 CPUs\n* 2GiB RAM\n* 40GB of disk space for the container or mounted as a persistent volume on `/home/steam/cs2-dedicated/`\n\n## Environment Variables\nFeel free to overwrite these environment variables, using -e (--env): \n\n### Server Configuration\n\n```dockerfile\nSRCDS_TOKEN=\"\"              (Game Server Token from https://steamcommunity.com/dev/managegameservers)\nCS2_SERVERNAME=\"changeme\"   (Set the visible name for your private server)\nCS2_CHEATS=0                (0 - disable cheats, 1 - enable cheats)\nCS2_SERVER_HIBERNATE=0      (Put server in a low CPU state when there are no players. \n                             0 - hibernation disabled, 1 - hibernation enabled\n                             n.b. hibernation has been observed to trigger server crashes)\nCS2_IP=\"\"                   (CS2 server listening IP address, 0.0.0.0 - all IP addresses on the local machine, empty - IP identified automatically)\nCS2_PORT=27015              (CS2 server listen port tcp_udp)\nCS2_RCON_PORT=\"\"            (Optional, use a simple TCP proxy to have RCON listen on an alternative port.\n                             Useful for services like AWS Fargate which do not support mixed protocol ports.)\nCS2_LAN=\"0\"                 (0 - LAN mode disabled, 1 - LAN Mode enabled)\nCS2_RCONPW=\"changeme\"       (RCON password)\nCS2_PW=\"changeme\"           (CS2 server password)\nCS2_MAXPLAYERS=10           (Max players)\nCS2_ADDITIONAL_ARGS=\"\"      (Optional additional arguments to pass into cs2)\n```\n\n**Note:** When using `CS2_RCON_PORT` don't forget to map the port chosen with TCP protocol (e.g., add `-p 27050:27050/tcp` on the `docker run` command or add the port to the `docker-compose.yml` file).\n\n### Game Modes\n\n```dockerfile\nCS2_GAMEALIAS=\"\"            (Game type, e.g. casual, competitive, deathmatch.\n                             See https://developer.valvesoftware.com/wiki/Counter-Strike_2/Dedicated_Servers)\nCS2_GAMETYPE=0              (Used if CS2_GAMEALIAS not defined. See https://developer.valvesoftware.com/wiki/Counter-Strike_2/Dedicated_Servers)\nCS2_GAMEMODE=1              (Used if CS2_GAMEALIAS not defined. See https://developer.valvesoftware.com/wiki/Counter-Strike_2/Dedicated_Servers)\nCS2_MAPGROUP=\"mg_active\"    (Map pool. Ignored if workshop maps are defined.)\nCS2_STARTMAP=\"de_inferno\"   (Start map. Ignored if workshop maps are defined.)\n```\n\n### Bots\n\n```dockerfile\nCS2_BOT_DIFFICULTY=\"\"       (0 - easy, 1 - normal, 2 - hard, 3 - expert)\nCS2_BOT_QUOTA=\"\"            (Number of bots)\nCS2_BOT_QUOTA_MODE=\"\"       (fill, competitive)\n```\n\n### CSTV/SourceTV\n\n```dockerfile\nTV_ENABLE=0                 (0 - disable, 1 - enable)\nTV_PORT=27020               (SourceTV/CSTV port to bind to)\nTV_AUTORECORD=0             (Automatically record all games as CSTV demos: 0=off, 1=on)\nTV_PW=\"changeme\"            (CSTV password for clients)\nTV_RELAY_PW=\"changeme\"      (CSTV password for relay proxies)\nTV_MAXRATE=0                (Max CSTV spectator bandwidth rate allowed, 0 == unlimited)\nTV_DELAY=0                  (CSTV broadcast delay in seconds)\n```\n\n### Logs\n\n```dockerfile\nCS2_LOG=\"on\"                ('on'/'off')\nCS2_LOG_MONEY=0             (Turns money logging on/off: 0=off, 1=on)\nCS2_LOG_DETAIL=0            (Combat damage logging: 0=disabled, 1=enemy, 2=friendly, 3=all)\nCS2_LOG_ITEMS=0             (Turns item logging on/off: 0=off, 1=on)\n```\n\n### Steam Workshop\n\nSupport for Steam Workshop is experimental!\n\n```dockerfile\nCS2_HOST_WORKSHOP_MAP=\"\"         (Steam Workshop Map ID to load on server start)   \nCS2_HOST_WORKSHOP_COLLECTION=\"\"  (Steam Workshop Collection ID to download)\n```\n\nIf a Workshop Collection is set, maps can be selected via rcon. E.g:\n\n```\nds_workshop_listmaps\nds_workshop_changelevel $map_name\n```\n\n# Customizing this Container\n\n## Validating Game Files\n\nIf you break the game through your customisations and want steamcmd to validate and redownload then set the `STEAMAPPVALIDATE` environment variable to `1`:\n\n```dockerfile\nSTEAMAPPVALIDATE=0          (0=skip validation, 1=validate game files)\n```\n\n## Pre and Post Hooks\n\nThe container includes two scripts for executing custom actions:\n\n* `/home/steam/cs2-dedicated/pre.sh` is executed before the CS2 server starts\n* `/home/steam/cs2-dedicated/post.sh` is executed after the CS2 server stops\n\nWhen using a persient volume mounted at `/home/steam/cs2-dedicated/` you may edit these scripts to perform custom actions, such as enabling metamod.\n\nAlternatively, you may have docker mount files from outside the container to override these files. E.g.:\n\n```\n-v /path/to/pre.sh:/home/steam/cs2-dedicated/pre.sh\n```\n\n## Overriding Game Mode Defaults\n\nThe default configurations for each game mode are stored in `/home/steam/cs2-dedicated/game/csgo/cfg/`. For example, the Competitive mode defaults are set by `gamemode_competitive.cfg`.\n\nWhen using a persistent volume mounted at `/home/steam/cs2-dedicated/`, these defaults can be overridden by adding your own settings to `gamemode_competitive_server.cfg`.\n\n```\n// Game Mode Competitive Server Overrides \n\nmp_maxrounds\t16\t// Shorter games\n```\n\n## Customisation Bundle\n\nThe container can be instructed to download a extract a Tar Gzip of configuration files and other customisations from a given URL.\n\n```dockerfile\nCS2_CFG_URL=\"\"          (HTTP/HTTPS URL to fetch a Tar Gzip bundle of configuration files/mods)\n```\n\nSee [examples](https://github.com/joedwards32/CS2/blob/main/examples/cs2.cfg.tgz) for a correctly formatted Tar Gzip customisation bundle.\n\n\n# Credits\n\nThis container leans heavily on the work of [CM2Walki](https://github.com/CM2Walki/), especially his [SteamCMD](https://github.com/CM2Walki/steamcmd) container image. GG!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCM2Walki%2FCS2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCM2Walki%2FCS2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCM2Walki%2FCS2/lists"}