Call of Duty 1 Server setup (Linux)

This guide walks you through setting up a Call of Duty 1 server on an Ubuntu Server. Follow the steps carefully to ensure a smooth setup. The guide support is for version 1.5 only.

Requirements

  • Ubuntu Server
  • Local IP of the server (e.g., 192.168.0.123)
  • A Copy of Call of duty patched to the 1.5 patch (steam version will work also)
  • Access to your router to forward ports (default: 28960)

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 cod1

Navigate to the directory:

cd cod1

Create a main folder

mkdir main

Copy all of your pk3 files from your existing games installed main folder. Use ssh (bitvise) or ftp if you have access. ONLY the .pk3 files are required!

Create a pb folder (optional for punkbuster support (defunct))

mkdir pb

Copy all of the files from your games installed pb folder. Use ssh (bitvise) or ftp if you have access.
Make sure Punkbuster is up to date!

With the cod1 folder as your working directory, download the server binary files:

wget grimms3dworlds.ddns.net/ul/cod1bins.tar.gz

Extract the files:

tar -xvf cod1bins.tar.gz

Remove the tar file:

rm cod1bins.tar.gz

This should result in the following file structure:

cod_lnxded
main/
    game.mp.i386.so
    pak0.pk3        pak9.pk3
    pak1.pk3        localized_english_pak0.pk3      //
    pak2.pk3        localized_english_pak1.pk3      // localized files may  
    pak3.pk3        localized_english_pak2.pk3      // differ depending
    pak4.pk3        localized_english_pak3.pk3      // on game language
    pak5.pk3        localized_english_pak4.pk3      // version.
    pak6.pk3        paka.pk3
    pak7.pk3        pakb.pk3
    pak8.pk3

Make the main executable file executable:

sudo chmod +x cod_lnxded

The MOHAA Spearhead binaries are 32-bit, and modern Linux distributions may lack 32-bit support. Enable it with:

sudo dpkg --add-architecture i386

Update the package list:

sudo apt update

Install the required 32-bit dependencies:

sudo apt-get install libc6-i386 libstdc++5:i386

Test the server installation:

./cod_lnxded

Once verified, press Ctrl+C to stop the server.

Server Configuration

Create a configuration file (e.g., server.cfg) in the mainta folder. Open it in a text editor and paste the following configuration:


// Call of Duty 1 (v1.5) Server Configuration File
// Save this as server.cfg in the 'main' folder of your Call of Duty installation
// Ensure the server is running version 1.5 (Steam version includes this patch)
//Punkbuster settings are NOT included

// --------------------------------
// Server Information
// --------------------------------
set sv_hostname "My CoD1 Server"           // Server name displayed in server browser
sets _Admin "Your Name"                    // Administrator name (optional)
sets _Email "admin@yourdomain.com"         // Administrator email (optional)
sets _URL "www.yourwebsite.com"            // Website URL (optional)
sets _Location "Your Location"             // Server location (e.g., "USA")
set scr_motd "Welcome to My CoD1 Server!"  // Message of the Day displayed to players
set gamename "Call of Duty"                // Game name for xFire or server lists

// --------------------------------
// Server Options
// --------------------------------
set sv_maxclients "16"                     // Maximum number of players (1-32 recommended)
set sv_privateclients "0"                  // Number of private slots (requires password)
set sv_privatePassword ""                  // Password for private slots (leave empty if unused)
set g_password ""                          // Server password (leave empty for public server)
//set rcon_password "change_me"            // Set this in the command line for security
set sv_pure "1"                            // Enforce pure server (1 = verify client files, 0 = off)
set sv_cheats "0"                          // Disable cheats (0 = off, 1 = on)
set sv_fps "20"                            // Server tick rate (20 is standard for CoD1)
set sv_allowAnonymous "0"                  // Allow anonymous players (0 = off, 1 = on)
set sv_floodprotect "1"                    // Enable flood protection (1 = on, 0 = off)
set g_inactivity "0"                       // Time (seconds) before kicking inactive players (0 = disabled)
set sv_timeout "40"                        // Seconds to keep a client without a message
set sv_connectTimeout "90"                 // Seconds to wait for a client loading a map
set sv_zombieTime "2"                      // Seconds to keep a disconnected client to transmit last message
set sv_reconnectlimit "5"                  // Seconds to disallow reconnects for a client

// --------------------------------
// Network Options
// --------------------------------
set sv_maxRate "25000"                     // Maximum data rate per client (bytes/sec, 25000 is standard)
set sv_minPing "0"                         // Minimum ping allowed (0 = no restriction)
set sv_maxPing "350"                       // Maximum ping allowed (0 = no restriction)
set sv_allowdownload "1"                   // Allow clients to download files (1 = on, 0 = off)
set sv_wwwDownload "0"                     // Enable HTTP/FTP downloads (0 = off, 1 = on)
set sv_wwwBaseURL ""                       // URL for HTTP/FTP downloads (e.g., "http://yourdomain.com/cod")
set sv_wwwDlDisconnected "0"               // Disconnect clients during download (0 = no, 1 = yes)

// --------------------------------
// Logging
// --------------------------------
set g_log ""                               // Log file name (e.g., "games_mp.log", empty = no logging)
set g_logsync "1"                          // Log sync mode (0 = no sync, 1 = sync, 2 = continuous)
set logfile "1"                            // Enable console logging (1 = on, 0 = off)

// --------------------------------
// Game Options
// --------------------------------
set g_allowvote "0"                        // Allow voting (0 = off, 1 = on)
set scr_allow_vote "0"                     // Allow specific votes (0 = off, 1 = on)
set scr_drawfriend "0"                     // Show friendly player icons (0 = off, 1 = on)
set scr_friendlyfire "0"                    // Friendly fire (0 = off, 1 = on, 2 = reflect, 3 = shared)
set scr_teambalance "1"                    // Auto team balance (0 = off, 1 = on)
set scr_forcerespawn "0"                   // Force players to respawn (0 = off, 1 = on)
set scr_killcam "0"                        // Enable killcam (0 = off, 1 = on)
set scr_spectatefree "0"                   // Allow free spectating (0 = off, 1 = on)
set scr_spectateenemy "0"                  // Allow spectating enemies (0 = off, 1 = on)

// --------------------------------
// Game Type Settings
// --------------------------------
// Deathmatch (dm)
set scr_dm_scorelimit "50"                 // Score limit for Deathmatch
set scr_dm_timelimit "30"                  // Time limit (minutes) for Deathmatch

// Team Deathmatch (tdm)
set scr_tdm_scorelimit "100"               // Score limit for Team Deathmatch
set scr_tdm_timelimit "30"                 // Time limit (minutes) for Team Deathmatch

// Behind Enemy Lines (bel)
set scr_bel_scorelimit "50"                // Score limit for Behind Enemy Lines
set scr_bel_timelimit "30"                 // Time limit (minutes) for Behind Enemy Lines
set scr_bel_alivepointtime "10"            // Seconds to gain a point for staying alive as Allied

// Retrieval (re)
set scr_re_scorelimit "10"                 // Score limit for Retrieval
set scr_re_timelimit "20"                  // Time limit (minutes) for Retrieval
set scr_re_graceperiod "15"                // Seconds at round start for spawning/weapon selection (0-60)
set scr_re_roundlength "4"                 // Round length (minutes)
set scr_re_roundlimit "0"                  // Maximum number of rounds (0 = unlimited)
set scr_re_showcarrier "0"                 // Show objective carrier on compass (0 = off, 1 = on)

// Search and Destroy (sd)
set scr_sd_scorelimit "10"                 // Score limit for Search and Destroy
set scr_sd_timelimit "30"                  // Time limit (minutes) for Search and Destroy
set scr_sd_graceperiod "15"                // Seconds at round start for spawning/weapon selection (0-60)
set scr_sd_roundlength "4"                 // Round length (minutes)
set scr_sd_roundlimit "0"                  // Maximum number of rounds (0 = unlimited)

// Headquarters (hq)
set scr_hq_scorelimit "0"                  // Score limit for Headquarters (0 = unlimited)
set scr_hq_timelimit "60"                  // Time limit (minutes) for Headquarters

// --------------------------------
// Weapon Settings
// --------------------------------
set scr_allow_m1carbine "1"                // Allow M1 Carbine (1 = on, 0 = off)
set scr_allow_m1garand "1"                 // Allow M1 Garand
set scr_allow_enfield "1"                  // Allow Lee-Enfield
set scr_allow_bar "1"                      // Allow BAR
set scr_allow_bren "1"                     // Allow Bren
set scr_allow_mp40 "1"                     // Allow MP40
set scr_allow_mp44 "1"                     // Allow MP44
set scr_allow_sten "1"                     // Allow Sten
set scr_allow_ppsh "1"                     // Allow PPSh-41
set scr_allow_thompson "1"                 // Allow Thompson
set scr_allow_panzerfaust "1"              // Allow Panzerfaust
set scr_allow_springfield "1"              // Allow Springfield
set scr_allow_kar98ksniper "1"             // Allow Kar98k Sniper
set scr_allow_nagantsniper "1"             // Allow Mosin-Nagant Sniper
set scr_allow_kar98k "1"                   // Allow Kar98k
set scr_allow_nagant "1"                   // Allow Mosin-Nagant
set scr_allow_mg42 "1"                     // Allow MG42

// --------------------------------
// Map Rotation
// --------------------------------
set sv_mapRotation "gametype tdm map mp_bocage gametype tdm map mp_depot gametype sd map mp_harbor gametype sd map mp_railyard gametype bel map mp_carentan gametype re map mp_chateau gametype hq map mp_dawnville" // Map rotation sequence
map_rotate                                 // Start map rotation

Note: Modify the configuration as needed, especially sv_hostname, rconpassword (set via command line for security), and map rotation settings.

Running the Server

Start the server with the following command:

./cod1_lnxded +set sv_punkbuster 0 +set dedicated 1 +set sv_maxclients 24 +set net_ip 192.168.0.123 +set net_port 28960 +set rconpassword mystrongpassword +exec server.cfg +map mp_carentan

Command Parameters:

  • sv_punkbuster: Turns punkbuster on or off
  • sv_maxclients: Sets the maximum number of players.
  • net_ip: The local IP of the server (e.g., 192.168.0.123).
  • net_port: The port for the server (default: 28960; use different ports for multiple servers).
  • rconpassword: Sets the RCON password for remote administration.
  • +exec server.cfg: Specifies the configuration file to use.
  • +map mp_carentan: Specifies the starting map for the game (without it the server wont start).

Port Forwarding: Ensure port 28960 (or your chosen port) is forwarded on your router to the server’s local IP. You should also forward 20500 and 20510. Other ports may be required.
IMPORTANT: For multiple servers the 20500 and 20510 ports are still valid, for a second server you only need to forward the main port (E.G. 28961)

Running as a Service

To run the server as a service in a tmux session, create the following systemd service files.

Master TMUX Service

Create /etc/systemd/system/master.service with:

[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

Call of Duty 1 Server Service

Create /etc/systemd/system/cod1server.service with:

[Unit]
Description=TMUX Call of Duty 1 Server
PartOf=master.service
After=master.service
[Service]
Type=forking
User=gameservers
ExecStart=/usr/bin/tmux new-session -s cod1server -d 'cd /home/gameservers/cod1 && +set sv_punkbuster 0 +set dedicated 1 +set sv_maxclients 24 +set net_ip 192.168.0.123 +set net_port 28960 +set rconpassword mystrongpassword +exec server.cfg +map mp_carentan'
ExecStop=/usr/bin/tmux kill-session -t cod1server
Restart=always
RestartSec=5
WorkingDirectory=/home/gameservers/mohaash
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

Enable and start the services:

Reload the systemd daemon:

sudo systemctl daemon-reload

Enable the master service:

sudo systemctl enable master.service

Enable the cod1server service:

sudo systemctl enable mohserver.service

Start the master service:

sudo systemctl start master.service

Start the cod1server service:

sudo systemctl start cod1server.service

Check the service status:

sudo systemctl status cod1server.service

Access the tmux session:

tmux attach-session -t cod1server

Note: The server will now run as a background service and automatically restart if it crashes. Use tmux to monitor or manage the session.

Bottom Left BackgroundBottom Right Background
Grimms 3D worlds
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.