This guide walks you through setting up a Call of Duty 2 dedicated server on an Ubuntu Server. Follow the steps carefully to ensure a smooth setup. The guide supports version 1.3 only.
Requirements
- Ubuntu Server
- Local IP of the server (e.g., 192.168.0.123)
- A Copy of Call of Duty 2 patched to version 1.3
- Access to your router to forward ports (default: 28960 UDP)
Optional: Create a User for the Server
We will use the username gameservers for this guide. You can change it to any name, but ensure consistency throughout.
Create the user:
sudo adduser --home /home/gameservers gameservers
Grant sudo access (optional):
sudo usermod -aG sudo gameservers
Switch to the user:
su - gameservers
Setting Up the Files
Create a new directory:
mkdir cod2
Navigate to the directory:
cd cod2
Create a main folder:
mkdir main
Copy all .iwd files from your Call of Duty 2 1.3 installation’s main folder into the server main folder. Use SFTP (FileZilla), Bitvise, or similar.
Required files include: iw_00.iwd → iw_15.iwd and the localized files (e.g. localized_english_iw00.iwd → localized_english_iw11.iwd).
Create a pb folder (optional – PunkBuster is defunct):
mkdir pb
With the cod2 folder as your working directory, download the server binary:
wget https://www.moddb.com/downloads/start/110849 -O cod2-lnxded-1.3.tar.bz2
Extract the files:
tar -xvf cod2-lnxded-1.3.tar.bz2
Remove the archive:
rm cod2-lnxded-1.3.tar.bz2
Make the binary executable:
chmod +x cod2_lnxded
The Call of Duty 2 binaries are 32-bit. Enable 32-bit support:
sudo dpkg --add-architecture i386
Update packages and install dependencies:
sudo apt update
sudo apt install libc6-i386 libstdc++5:i386 lib32stdc++6
Test the server:
./cod2_lnxded
Press Ctrl+C to stop the test.
⚠️ Important Warning: Mod Files
Do not place mod files directly into the main/ folder.
Doing so can corrupt client downloads, cause version mismatches, and break the game for players who have a clean installation. Always place mods in their own folder under cod2/mods/ (see Mod Setup section below).
Server Configuration
Create server.cfg inside the main folder and paste the cleaned configuration below:
// Call of Duty 2 v1.3 Server Configuration
// Save as main/server.cfg
set rcon_password "your_strong_rcon_password" // Better to set via command line
set sv_privatePassword ""
set g_password "" // Leave empty for public server
set sv_hostname "My CoD2 Server"
set scr_motd "Welcome to My CoD2 Server!"
set sv_maxclients "32"
set sv_privateClients "0"
set sv_pure "1"
set sv_cheats "0"
set sv_allowAnonymous "0"
set sv_floodProtect "1"
set g_log "server_mp.log"
set g_logSync "1"
set logfile "2"
set sv_maxRate "25000"
set sv_minPing "0"
set sv_maxPing "250"
set sv_allowdownload "1"
set sv_wwwDownload "1"
set sv_wwwBaseURL "" // e.g. http://yourdomain.com/cod2redirect
set sv_wwwDlDisconnected "0"
set g_allowvote "0"
set scr_teambalance "1"
set scr_forcerespawn "1"
set scr_killcam "0"
set scr_spectatefree "0"
set scr_spectateenemy "0"
set g_gametype "tdm" // Change to dm, sd, ctf, hq as needed
// Game Type Limits
// TDM
set scr_tdm_scorelimit "300"
set scr_tdm_timelimit "20"
// DM
set scr_dm_scorelimit "50"
set scr_dm_timelimit "15"
// SD
set scr_sd_scorelimit "10"
set scr_sd_timelimit "0"
set scr_sd_roundlimit "0"
set scr_sd_graceperiod "15"
set scr_sd_roundlength "4"
// CTF / HQ (add your preferred values)
// Weapon Restrictions (1 = enabled, 0 = disabled)
set scr_allow_m1garand "1"
set scr_allow_m1carbine "1"
set scr_allow_thompson "1"
set scr_allow_bar "1"
set scr_allow_springfield "1"
set scr_allow_enfield "1"
set scr_allow_sten "1"
set scr_allow_bren "1"
set scr_allow_kar98k "1"
set scr_allow_mp40 "1"
set scr_allow_mp44 "1"
set scr_allow_nagant "1"
set scr_allow_ppsh "1"
set scr_allow_kar98ksniper "1"
set scr_allow_enfieldsniper "1"
set scr_allow_nagantsniper "1"
set scr_allow_svt40 "1"
set scr_allow_g43 "1"
set scr_allow_shotgun "1"
set scr_allow_pps42 "1"
set scr_allow_greasegun "1"
set scr_allow_smokegrenades "0"
set scr_allow_fraggrenades "1"
// Map Rotation Example (TDM)
set sv_mapRotation "gametype tdm map mp_breakout gametype tdm map mp_burgundy gametype tdm map mp_carentan gametype tdm map mp_dawnville gametype tdm map mp_decoy gametype tdm map mp_matmata gametype tdm map mp_railyard gametype tdm map mp_toujane"
map_rotate
HTTP Redirect Setup (Fast Downloads)
To reduce bandwidth usage on the game server and speed up player joins, set up an HTTP redirect:
- Upload all client-needed files (mostly .iwd files from
main/and your mod folder) to a web server. - Do NOT upload files containing
svrin the name (server-only files). - Set the URL in your config:
set sv_wwwBaseURL "http://yourdomain.com/cod2redirect" - Enable with
set sv_wwwDownload "1"andset sv_allowdownload "1".
Tip: Use Apache/Nginx with directory listing disabled. Keep filenames short and limit the total number of .iwd files.
Mod Setup (Important)
To run a mod (e.g. Promod, custom maps, etc.):
- Create a folder inside
cod2/mods/with your mod name (e.g.mods/promod) - Place all mod files (
.iwd,mod.ff, scripts, etc.) inside that folder. - Add to your startup line or config:
+set fs_game "mods/promod"
Running the Server
Start the server with (use dedicated 1 for production/internet servers):
./cod2_lnxded +set dedicated 1 +set sv_punkbuster 0 +set net_ip 192.168.0.123 +set net_port 28960 +set rcon_password "your_strong_rcon_password" +exec server.cfg +map mp_carentan
Port Forwarding: Forward UDP port 28960 (and preferably 20500-20510) to your server’s local IP.
dedicated 1 = Internet / production server.
Running as a Service (systemd + tmux)
Create the service files as root.
Master TMUX Service
Why do we need a master service? Without it, systemd may spawn multiple tmux instances when restarting services, leading to orphaned sessions and duplicate servers. The master session keeps everything under one controlled tmux environment.
sudo nano /etc/systemd/system/master.service
Paste:
[Unit]
Description=tmux master service
Wants=network-online.target
[Service]
Type=forking
User=gameservers
ExecStart=/usr/bin/tmux new-session -s master -d
ExecStop=/usr/bin/tmux kill-session -t master
[Install]
WantedBy=multi-user.target
CoD2 Server Service
sudo nano /etc/systemd/system/cod2server.service
Paste (adjust paths and startup command as needed):
[Unit]
Description=Call of Duty 2 Server
PartOf=master.service
After=master.service
[Service]
Type=forking
User=gameservers
WorkingDirectory=/home/gameservers/cod2
ExecStart=/usr/bin/tmux new-session -s cod2server -d './cod2_lnxded +set dedicated 1 +set sv_punkbuster 0 +set net_ip 192.168.0.123 +set net_port 28960 +set rcon_password "your_strong_rcon_password" +exec server.cfg +map mp_carentan'
ExecStop=/usr/bin/tmux kill-session -t cod2server
Restart=always
RestartSec=5
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable master.service
sudo systemctl enable cod2server.service
sudo systemctl start master.service
sudo systemctl start cod2server.service
Check status and attach to console:
sudo systemctl status cod2server.service
tmux attach-session -t cod2server
Note: The server will now run automatically and restart on crash. Detach from tmux with Ctrl+B then D.

