Installation

Install Metamod:Source and Source2Mod on a Counter-Strike 2 server, and check that both are running.

Source2Mod is a Metamod:Source plugin, so a server needs Metamod first and Source2Mod on top of it. Both are folders you copy into game/csgo/. Linux and Windows servers are both supported.

Prerequisites

  • A Counter-Strike 2 dedicated server you can restart and reach the console of.
  • Metamod:Source 2.x — a current dev build, matching your OS.
  • The latest Source2Mod release — source2mod_<version>-linux.tar.gz or source2mod_<version>-windows.tar.gz.

CS2 updates regularly break older Metamod builds. When the server stops loading Metamod after a game update, update Metamod before looking anywhere else.

Install Metamod:Source

Download the Metamod:Source build for your operating system and extract it.

Copy its addons/ folder into your server's game/csgo/ folder, so that you end up with game/csgo/addons/metamod/.

Open game/csgo/gameinfo.gi, find the line

Game_LowViolence	csgo_lv // Perfect World content override

and add this line below it:

Game	csgo/addons/metamod

Start the server and run meta list in its console. If the command is known, Metamod is loaded.

Game updates overwrite gameinfo.gi. If Metamod disappears after an update, the Game csgo/addons/metamod line is the first thing to check.

Install Source2Mod

Download the release archive for your operating system and extract it. It contains a single addons/ folder.

Copy that addons/ folder into game/csgo/, merging it with the one Metamod created.

Restart the server. Source2Mod has to be loaded at server start: loading it later with meta load is refused (Late load is not supported).

What the release contains

game/csgo/addons/
├── metamod/
│   └── source2mod.vdf          # tells Metamod to load Source2Mod
└── source2mod/
    ├── bin/
    │   └── linuxsteamrt64/          # win64/ in the Windows archive
    ├── configs/
    │   └── core.example.json        # template for core.json
    ├── gamedata/
    │   └── gamedata.json            # the core's signatures and offsets
    ├── plugins/                     # your .smx plugins go here
    ├── shared/                      # data more than one plugin reads
    └── dumps/                       # crash dumps land here
FolderWhat it is for
bin/The s2m core binary.
configs/core.json, permissions.json (admins and groups, see Permissions), and one configs/<PluginName>/ folder per plugin for its own config files (PLUGIN_CONFIG_DIR()).
gamedata/Every .json file here is loaded at start. Plugins that need signatures of their own ship an extra file next to gamedata.json — see Gamedata.
plugins/Every .smx file here is loaded at start.
shared/Data files read by more than one plugin (SOURCE2MOD_SHARED_DIR()).
dumps/Minidumps and crash reports written by the crash handler.

Missing folders are created on start, so deleting an empty one does no harm.

Core configuration

On its first start the core copies configs/core.example.json to configs/core.json and reads that from then on. Releases only ship the example, so updating Source2Mod never overwrites your settings.

configs/core.json
{
  "PublicChatTrigger": [ "!" ],
  "SilentChatTrigger": [ "/" ],
  "PluginHotReloadEnabled": true,
  "PluginAutoLoadEnabled": true,
  "UnlockConCommands": true,
  "UnlockConVars": true,
  "CrashHandlerEnabled": true,
  "CrashDiscordWebhook": "",
  "SlowCallbackWarnMs": 100,
  "SteamAuthMode": "auto",
  "AccessDeniedMessage": "You do not have access to this command."
}

The file may contain // and /* */ comments.

KeyDefaultMeaning
PublicChatTrigger["!"]Chat prefixes that run a command. !mycommand runs the plugin command mycommand and the message still shows in chat.
SilentChatTrigger["/"]Same, but the chat message is suppressed.
PluginHotReloadEnabledtrueLinux only: reload a plugin when its .smx is rewritten. See Plugin lifecycle.
PluginAutoLoadEnabledtrueLoad every .smx in plugins/ at start. When false, nothing loads until you run s2m refresh or s2m load.
UnlockConCommandstrueRemove FCVAR_HIDDEN and FCVAR_DEVELOPMENTONLY from every console command, so hidden commands can be used.
UnlockConVarstrueThe same for ConVars.
CrashHandlerEnabledtrueInstall the crash handler.
CrashDiscordWebhook""Discord webhook URL for crash reports. Empty disables Discord reporting; dumps are still written.
SlowCallbackWarnMs100A plugin callback that takes longer than this is logged with its name and plugin — see Compatibility. 0 turns it off.
SteamAuthMode"auto"Which SteamID a player's permissions are looked up under: "auto", "flexible" or "strict".
AccessDeniedMessage"You do not have access to this command."What a player is told when refused a command, unless a plugin set its own answer.

The file is read once, when the core loads. Restart the server after changing it.

Installing plugins

Copy a plugin's .smx file into addons/source2mod/plugins/. If it comes with configs, gamedata or shared data, those go into configs/, gamedata/ and shared/ as its instructions say.

On a running server, s2m refresh loads every .smx in plugins/ that is not loaded yet; a new gamedata file, however, is only read when the server restarts.

One plugin most servers want: CustomhudManager_s2t, the Panorama HUD — menus on the HUD, on-screen texts, toasts, timers. Plugins that draw on the HUD ask for its interface at load; without it they draw nothing. Its players need the addon described in HUD menus, texts and prompts.

Verifying the installation

Run meta list in the server console. Source2Mod should be in the list of Metamod plugins.

Then ask Source2Mod itself. The console command is s2m (with the aliases source2mod and sm):

s2m version
s2m list
CommandWhat it does
s2m listLists loaded plugins as [id] name (version) by author, with a second line per plugin: its plugin API version, the KHook commit it was built against and its tier — stable (no KHook hooks of its own: a game or KHook change needs only a core update) or raw (rebuild). See Compatibility.
s2m info <id>Name, version, author, description, file path, plugin API, KHook commit, how many hooks of its own it declared, and every Source2Mod interface (with revision) it asked for.
s2m load <name>Loads the first .smx in plugins/ whose file name contains <name>.
s2m unload <id>Unloads a plugin by the id s2m list shows.
s2m refreshLoads every .smx in plugins/ that is not loaded yet.
s2m versionSource2Mod version, plugin API version, build date and commit.
s2m creditsWho made it.

load, unload and refresh work only from the server console (or RCON). Players can run list, info, version and credits from their own console.

When something does not load

  • Source2Mod is not in meta list — Metamod is not loading it. Check that addons/metamod/source2mod.vdf exists and that the bin/ folder for your OS is there.
  • A plugin is missing from s2m list — the core prints why at start: Plugin <name> refused to load: <reason> or Failed to load <path>: <reason>, followed by a summary line with the number that failed. A KHook mismatch reason means the plugin was built against a different KHook than the core runs; see the FAQ.
  • The server crashes on start — see the crash handler guide; the report on the next start names the module that crashed.

On this page