Skip to content

Server Configuration

Complete reference for the CoD2 server.cfg file.

Config File Location

main/server.cfg

Edit this file via SFTP. Changes take effect after a server restart.

TIP

If you're running a mod, the mod can have its own server.cfg at mods/<modname>/server.cfg. Settings in the mod config override the main config.

Example Configuration

ini
// ============================================================
// Server Identity
// ============================================================
set sv_hostname "My uHost CoD2 Server"
set sv_maxclients "24"
set sv_privateClients "0"

// ============================================================
// Passwords
// ============================================================
set rcon_password "changeme123"
set g_password ""
set sv_privatePassword ""

// ============================================================
// Network
// ============================================================
set sv_maxRate "25000"
set sv_floodProtect "1"
set sv_pure "1"

// ============================================================
// Downloads
// ============================================================
set sv_allowDownload "1"
// FastDL is auto-configured on uHost. No need to set
// sv_wwwDownload or sv_wwwBaseURL manually.

// ============================================================
// Gameplay
// ============================================================
set g_gametype "tdm"
set scr_teambalance "1"
set scr_friendlyfire "0"
set g_allowvote "1"
set g_antilag "1"
set sv_voice "1"

// ============================================================
// Team Deathmatch Settings
// ============================================================
set scr_tdm_timelimit "20"
set scr_tdm_scorelimit "0"

// ============================================================
// Search & Destroy Settings
// ============================================================
set scr_sd_timelimit "2.5"
set scr_sd_scorelimit "0"

// ============================================================
// Map Rotation
// ============================================================
set sv_mapRotation "gametype tdm map mp_toujane map mp_carentan map mp_brecourt gametype sd map mp_carentan map mp_dawnville"
set sv_mapRotationCurrent ""

Settings Reference

Server Identity

CVarDescriptionDefault
sv_hostnameServer name shown in the browser and on connect.""
sv_maxclientsMaximum number of player slots.20
sv_privateClientsNumber of slots reserved for players who know sv_privatePassword.0
sv_privatePasswordPassword for reserved slots.""
g_motdMessage of the day shown to players on connect.""

Passwords

CVarDescription
rcon_passwordPassword for remote console access. Must be at least 8 alphanumeric characters.
g_passwordServer join password. Leave empty for a public server.
sv_privatePasswordPassword to access reserved private slots.

Network

CVarDescriptionDefault
sv_maxRateMaximum data rate per client in bytes/sec. 25000 is standard.25000
sv_minRateMinimum data rate per client.5000
sv_maxPingKick players with ping above this value. 0 = no limit.0
sv_floodProtectRate-limit client commands to prevent spam.1
sv_timeoutSeconds before an idle client is dropped.40

File Downloads

CVarDescriptionDefault
sv_allowDownloadAllow clients to download missing files from the server.1
sv_wwwDownloadEnable HTTP redirect for faster downloads (FastDL).Auto
sv_wwwBaseURLBase URL for HTTP downloads.Auto
sv_pureEnforce file purity. Rejects clients with modified .iwd files.1

FastDL on uHost

FastDL is configured automatically on uHost servers. The server's built-in HTTP server (nginx) serves mod files at full speed. You don't need to set sv_wwwDownload or sv_wwwBaseURL unless you want to use your own external download server.

Gameplay

CVarDescriptionValues
g_gametypeActive game mode.dm, tdm, sd, ctf, hq
g_allowvoteAllow players to call votes.0 off, 1 on
g_antilagLag compensation. Keep this 1 for online play.0 off, 1 on
scr_teambalanceAuto-balance teams.0 off, 1 on
scr_friendlyfireFriendly fire mode.0 off, 1 on, 2 reflect, 3 shared
sv_voiceEnable in-game voice chat.0 off, 1 on

Per-Game-Type Settings

Each game type has its own score and time limits. Replace <type> with the game type code (dm, tdm, sd, ctf, hq).

CVarDescription
scr_<type>_scorelimitScore needed to win. 0 = no limit.
scr_<type>_timelimitTime limit in minutes. 0 = no limit.
scr_<type>_numlivesLives per player per round. 0 = unlimited.

Search & Destroy has additional settings:

CVarDescriptionDefault
scr_sd_bombtimerSeconds until planted bomb detonates.45
scr_sd_planttimeSeconds to plant the bomb.5
scr_sd_defusetimeSeconds to defuse the bomb.5

Logging

CVarDescriptionDefault
g_logLog file name.games_mp.log
g_logsyncLogging mode. 0 = off, 1 = buffered, 2 = continuous.2
logfileEnable the log file.1

Map Rotation

The sv_mapRotation CVar defines the map and game type cycle. Format:

gametype <type> map <internal_name> map <internal_name> gametype <type> map <internal_name>

The gametype keyword persists until the next gametype keyword. This means you can list multiple maps under the same game type without repeating it:

ini
// TDM on Toujane and Carentan, then S&D on Carentan and Dawnville
set sv_mapRotation "gametype tdm map mp_toujane map mp_carentan gametype sd map mp_carentan map mp_dawnville"

See the Overview for the full list of map names.

FastDL (HTTP Redirect Downloads)

By default, CoD2 transfers mod files to clients over UDP, which is extremely slow. FastDL redirects these downloads to an HTTP server for full-speed transfers.

On uHost, FastDL is configured automatically. The server runs a built-in nginx instance that serves files from your mods/ directory over HTTP. No setup is required.

If you need to use a custom download server instead:

ini
set sv_wwwDownload "1"
set sv_wwwBaseURL "http://your-download-server.com/cod2/"

The HTTP server directory must mirror your game server's file structure:

server/
  mods/
    mymod/
      mod.ff
      z_mymod.iwd

Stop Paying for Empty Servers.