Live 9 humans online 2 active servers Peak online today 26 Record 102

SoF2 server.cfg Explained (With an Example Config)

A complete, commented Soldier of Fortune II server.cfg: server name, players, passwords, game type, limits, voting, teams and logging.

Updated 3 min read Servers and hosting

A Soldier of Fortune II server.cfg is a text file of settings that the server runs when it starts. It sets the server name, player limit, passwords, game type, time and score limits, voting and team rules, and it ends by loading the first map. Put it in the base folder (or your mod’s folder) and start the server with +exec server.cfg.

A complete example

Copy this, change the name, passwords and limits, and save it as server.cfg. Lines starting with // are comments.

// ── Identity ─────────────────────────────
seta sv_hostname "^3My ^7SoF2 Server"
seta g_motd "Welcome! Stats: sof2mp.com"
sets Admin "YourName"
sets Discord "discord.gg/yourinvite"

// ── Players and passwords ─────────────────
seta sv_maxclients "16"
seta g_password ""              // set to make the server private
seta rconpassword "change-this-to-something-long"

// ── Game ──────────────────────────────────
seta g_gametype "ctf"
seta timelimit "20"
seta scorelimit "10"
seta g_roundtimelimit "5"       // round-based modes (INF, ELIM, DEM)
seta g_friendlyFire "0"
seta g_teamForceBalance "1"
seta g_teamAutoJoin "0"
seta g_warmup "20"

// ── Weapons ───────────────────────────────
seta disable_pickup_weapon_RPG_7 "0"
seta disable_pickup_weapon_MM_1 "0"

// ── Voting ────────────────────────────────
seta g_allowVote "1"
seta g_voteDuration "30"
seta g_failedVoteDelay "1"

// ── Housekeeping ──────────────────────────
seta g_inactivity "180"
seta sv_floodProtect "1"
seta sv_maxPing "0"
seta g_log "games.log"
seta sv_punkbuster "0"

// ── Map rotation and first map ────────────
seta sv_mapcycle "mapcycle.txt"
map mp_shop

The settings explained

Identity

sv_hostname is the name shown in server lists. It can use colour codes, as described in coloured names. sets adds extra public information, such as an admin’s name or a Discord link, that players see in the server’s details.

Identity and player limit
CVARWhat it doesDefaultRecommended
sv_hostnameThe server name displayed in the server browser.noname—
sv_maxclientsMaximum number of players (including bots) that can connect to the server.8—

Passwords

rconpassword lets you run admin commands remotely. Make it long and never share it in chat. g_password makes the whole server private: leave it empty for a public server. Read more in admin commands.

Game type and limits

g_gametype takes a short code: dm, tdm, ctf, elim, inf or dem. Each is explained in game types. A match ends when the time limit or the score limit is reached, whichever comes first.

Limits
CVARWhat it doesDefaultRecommended
timelimitMatch time limit in minutes. 0 = no time limit.0—
scorelimitScore required to win the match. 0 = no score limit.20—
g_roundtimelimitTime limit per round in minutes. 0 = no round time limit.5—
g_warmupDuration of the warmup period in seconds before a match begins.20—
g_suddenDeathEnables sudden death when the round is tied at time expiry.1—

Teams

Team settings
CVARWhat it doesDefaultRecommended
g_friendlyFireEnables friendly fire so players can damage teammates.0—
g_teamForceBalancePrevents players from joining a team that already has more players.0—
g_teamAutoJoinAutomatically places new players into a team when they connect.0—
g_teamkillPenaltyScore adjustment applied to a player for each team kill.-1—

Voting

Voting settings
CVARWhat it doesDefaultRecommended
g_allowVoteAllows players to call votes for map changes, kicks, and other actions.11
g_voteDurationTime in seconds that a vote remains open for players to cast their ballot.60—
g_failedVoteDelaySeconds players must wait before calling another vote after one fails.1—
g_voteKickBanTimeMinutes a player kicked by vote is banned from reconnecting. 0 = kick only, no ban.0—

Housekeeping

Kick idle players, stop chat spam and keep a log. The log file is useful for your own statistics, and SOF2MP.com builds its stats by asking servers for their status, so no log sharing is needed to be listed.

Housekeeping settings
CVARWhat it doesDefaultRecommended
g_inactivitySeconds of inactivity before a player is moved to spectator.180—
sv_floodProtectEnables flood protection to prevent chat and command spamming.11
sv_maxPingMaximum allowed player ping in milliseconds. 0 = no limit.0—
g_logFilename for the game event log.games.log—
sv_punkbusterEnables PunkBuster anti-cheat enforcement on the server.00

Restricting weapons

Each weapon has its own setting: 0 allows it, 1 stops players picking it up, and 2 removes it from the map entirely. Many servers remove the RPG-7 and MM-1 grenade launcher. The full list is in SoF2 weapons.

Mod settings

Mods such as RoCmod add many settings of their own. Put them in the same server.cfg, inside the mod’s folder, and check the mod’s documentation for names and values.

Applying changes

Most settings take effect on the next map. Run /rcon exec server.cfg to reload the file, then /rcon map_restart. A few, such as sv_maxclients, need a full server restart.

Frequently asked questions

Where does server.cfg go?

In the base folder, or in your mod’s folder when running a mod. Load it with +exec server.cfg on the start command.

What’s the difference between set, seta and sets?

set changes a setting, seta also saves it to the config the game writes, and sets adds it to the public server information players can see.

Why aren’t my settings working?

The file may be in the wrong folder, or a mod’s own config may be overriding it. Check the server console when it starts: it shows each config it runs.

Written and kept up to date by the SOF2MP.com community. Live numbers on this page come from our own tracking of every public SoF2 server. Spotted something out of date? Tell us on Discord.