Call of Duty 2 is the most-hosted game in the classic CoD family, and cod2_lnxded is
still a completely reasonable thing to run: a 1.3 server idles at a few MB of RAM and
almost no CPU. The parts that trip people up are the 32-bit runtime, the switch from
.pk3 to .iwd, and the fact that the Activision master has been unreliable for years.
Once your server is online, find it in the Call of Duty 2 server list on MantaScope to check its public listing and player count.
What you need
| Item | Notes |
|---|---|
| Game paks | iw_*.iwd plus localized_english_iw*.iwd from a legitimate install |
| Dedicated binary | cod2_lnxded (Linux) or CoD2MP_s.exe +set dedicated 2 (Windows) |
| Patch | 1.3 — the only version worth running |
| Ports | UDP 28960 inbound |
| RAM | ~100 MB per instance |
The 1.3 patch is on the war24.net downloads page. Patch 1.0 and 1.2 servers cannot be joined by 1.3 clients, and effectively every client is 1.3.
Directory layout
/opt/cod2/
├── cod2_lnxded
└── main/
├── iw_00.iwd … iw_15.iwd
├── localized_english_iw00.iwd …
└── server.cfg
The exact highest iw_NN number depends on your patch level, so copy whatever your
install has rather than matching a list from a forum post.
Unlike CoD1, CoD2 pak archives use the .iwd extension. They are still plain zip
files: unzip -l iw_00.iwd works.
32-bit libraries
cod2_lnxded is i386. On Debian or Ubuntu:
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y libc6:i386 libgcc-s1:i386 lib32stdc++6 libstdc++5:i386
server.cfg
seta sv_hostname "^3My ^7CoD2 Server"
set rcon_password "change-me"
set g_gametype "tdm"
set sv_maxclients 20
set sv_pure 1 // 0 if you load a mod .iwd
set sv_allowDownload 1
set sv_maxRate 25000
set sv_fps 20
set sv_timeout 60
set sv_floodProtect 1
set g_allowVote 1
set g_antilag 1
set scr_friendlyfire 0
set scr_killcam 1
set scr_teambalance 1
set g_deadChat 1
set logfile 1
set g_log "games_mp.log"
set g_logsync 0
set scr_tdm_timelimit 15 // minutes
set scr_tdm_scorelimit 500
set scr_sd_roundlimit 0
set scr_sd_timelimit 2
set sv_mapRotation "gametype tdm map mp_toujane map mp_carentan map mp_brecourt"
map_rotate
rcon_password has an underscore on CoD2. CoD1 and CoD:UO spell it rconpassword.
Copying a CoD1 config across is the single most common reason rcon "does not work" on a new
CoD2 server.
Gametype cvars are prefixed per gametype, so the timelimit for Team Deathmatch is
scr_tdm_timelimit and for Search & Destroy it is scr_sd_timelimit. Setting
scr_dm_timelimit while running tdm does nothing. The full table is on the
cvar reference.
Starting the server
cd /opt/cod2
./cod2_lnxded \
+set fs_basepath /opt/cod2 \
+set fs_homepath /opt/cod2 \
+set dedicated 2 \
+set net_port 28960 \
+set sv_maxclients 20 \
+set rcon_password "change-me" \
+exec server.cfg \
+map mp_toujane
dedicated 2 is internet, dedicated 1 is LAN. On a 64-bit host, prefix with
setarch i386 -R so the 2005 binary gets a non-randomised address space.
systemd unit
[Unit]
Description=Call of Duty 2 dedicated server
After=network-online.target
[Service]
Type=simple
User=cod2
WorkingDirectory=/opt/cod2
ExecStart=/usr/bin/setarch i386 -R /opt/cod2/cod2_lnxded \
+set fs_basepath /opt/cod2 +set fs_homepath /opt/cod2 \
+set dedicated 2 +set net_port 28960 \
+exec server.cfg +map mp_toujane
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
CoD2x
CoD2x is the community extension for 1.3. On the client it adds widescreen support, higher FPS limits and a pile of bug fixes; on the server it is a shared object you preload:
LD_PRELOAD=/opt/cod2/libCoD2x.so ./cod2_lnxded +set dedicated 2 ...
A CoD2x server still accepts stock 1.3 clients, so enabling it costs you nothing in reach. Most of the active competitive scene runs it.
Mods
CoD2 mods live in main/ as .iwd files, or in a separate mod directory selected with
fs_game:
set fs_game "mods/zpam336"
With fs_game set, the engine reads mods/zpam336/*.iwd on top of main/. That is how
zPAM, ePAM and PAMD ship. Set sv_pure 0 unless you have tested the checksum path.
The long-running competition mods are:
| Mod | Purpose |
|---|---|
| zPAM (3.36) | The current standard match mod. pam_mode cg, cg_2v2, pub. |
| ePAM (1.02b) | Older match mod, still seen on public servers. |
| PAMD (1.05) | Another PAM derivative with cb, cb_2v2, cb_1v1 modes. |
| CoDJumper | Jump mod, gametype codjumper. |
Mod modes are usually selected by a console argument after the config, e.g.
+pam_mode cg on the command line.
See installing Call of Duty mods.
Fast download
CoD2 supports HTTP redirect downloads, which is the difference between a 4-second and a 4-minute join for a 40 MB map pack:
set sv_allowDownload 1
set sv_wwwDownload 1
set sv_wwwBaseURL "http://files.example.com/cod2"
set sv_wwwDlDisconnected 0
The URL must serve the same relative path the client asks for, i.e.
http://files.example.com/cod2/main/mymap.iwd. Full nginx configuration is in the
fast download guide.
Getting listed
cod2master.activision.com:20710 is the original master and is unreliable. In practice
most CoD2 players find servers through community lists rather than the in-game browser, so
publish your address, and check cod.pm to confirm your server is
answering queries from the outside.
Verify from another machine with a raw Quake3 getstatus:
printf '\xff\xff\xff\xffgetstatus' | nc -u -w2 YOUR.IP 28960 | head -c 400
If that returns a config string dump your server is reachable and any browser problem is master-side, not firewall-side.
Map codes
Stock 1.3 ships 13 base maps plus Rostov and Wallendar from the free map packs. The full
list with codes is on the Call of Duty 2 map list. The default in most
rotations is mp_toujane.
