@sachithrrra

Published on

How to Setup a COD4 Server on Linux

Call of Duty 4: Modern Warfare is one of the best multiplayer shooting games of all time. Despite being the game 13 years old, there are many public servers out there. But if you want to play COD4 with your best friends, you will need a private server with RCON permissions. There are some free services to host private servers like FSHOST, but if you need a custom server with your configurations, this guide is for you.

Table of Contents

Requirements

  • VPS (Virtual Private Server) running Debian
  • CoD4 game files
  • CoD4x server files
  • CoD4 mod files
  • Server config file

Installation

Login to the VPS

Update packages and repos of your linux VPS.

apt-get update apt-get upgrade

Install screen if you’re not sure it is installed by default.

apt-get install screen

Call of Duty 4 server only runs on i386 machines, to enable multiarch feature, perform following commands.

dpkg --add-architecture i386 apt-get update apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

Create a directory for the server.

cd /home mkdir servers

Download COD4 game files to the directory.

cd servers wget https://ia802600.us.archive.org/26/items/cod4_linux_server_files_201501/cod4_linux_server_files.zip

After downloading, unzip the compressed game files package.

apt-get install unzip (if unzip is not installed on your vps) unzip cod4_linux_server_files.zip

Rename the cod4_linux_server_files directory to any name you like. (I renamed it as cod4)

Download CoD4X server files to the directory.

cd cod4 wget https://cod4x.me/downloads/cod4x_server-linux.zip

Unzip CoD4X server files.

unzip cod4_linux_server_files.zip

Upload mod and server cfg file. You should place the server.cfg file on your mods folder.

Call of Duty Promod – https://promod.github.io/

Here is my sample server.cfg file

// promod live v2 - sample server config v1.4 // for public ruleset customizations, see z_c_r.iwd // info strings sets _Admin "SACH" sets _Email "" sets _Website "" sets _Location "" sets _Irc "" sets sv_hostname "^1Techie ^3Reports" // welcome message, message of the day (motd) seta scr_motd "^2Welcome ^1to ^5Techie ^3Reports" // Network options set net_ip "XX.XX.XXX.XXX" // Set your servers IP address // password settings set rcon_password "XXXXXXXX" // use more than 8 characters set sv_privatePassword "" // private slots password set g_password "XXX" // server password // player slots, maxclients - privateclients = public slots set sv_maxclients "16" // maximum number of clients set sv_privateclients "" // number of private slots // map rotation set sv_maprotationcurrent "" // leave empty set sv_mapRotation "gametype sd map mp_crossfire gametype sd map mp_backlot gametype sd map mp_crash gametype sd map mp_strike" // promod settings set promod_mode "match_mr12_pb" // promod mode, for a list of promod modes see attached readme set promod_enable_scorebot "0" // match-modes only

Update permissions of all the added files.

chmod -R 777 main pb mods

Create a server initializing file.

nano start.sh

Paste the following lines to the start.sh file. Make sure to make the path according to your VPS. Then save the start.sh file.

#!/bin/bash screen -dmS cod4 ./cod4x18_dedrun +set dedicated 2 +set sv_authorizemode 0 +set sv_punkbuster 1 +exec server.cfg +set net_port 28960 +set fs_basepath /home/*YourUsername*/servers/cod4 +set fs_homepath /home/*YourUsername*/servers/cod4 +set fs_game mods/pml220 +map_rotate

Update permissions of the start.sh file.

chmod -R 777 start.sh

Initialize start.sh file.

./start.sh

Final directory structure.

directory structure
directory structure 2

Notes

  • Check the paths of the config files.
  • Whitelist 28960, 20800, 20810 ports on your VPS. This is needed so anyone can access your server from their computer.
  • RCON password should have 8 characters.
  • You should have a way to upload files from your PC to the VPS. If you have a linux desktop environment installed and you have a remote connection to the VPS this won’t be needed.