How to Setup a Call of Duty 4 Server on Debian Linux
Posted by Freelander | Filed under Howto Articles

This howto describes the installation steps of a Call of Duty 4 server on Debian Linux.
If you’re willing to setup a Call of Duty, Call of Duty 2 or a Call of Duty: World at War (CoD5) Server on Linux you can simply follow the similar steps of this tutorial.
I have written and tested this howto with a fresh install of Debian Lenny on WMware.
Prerequisities
- An original DVD of the game.
- Call of Duty 4 dedicated linux server files. You can download the latest package (with 1.7 patch) here.
- Debian server with internet connection and a static IP.
Create required directories
I recommend installing the game in your home folder. I will use the username “freelander” for this howto, you use yours. Now to keep things organized, create a “games” folder and a “cod4″ folder in it using commands below:
$ cd /home/freelander/
$ mkdir games
$ cd games
$ mkdir cod4
Install the game files
Now that we have our cod4 folder we can start installing our game files. Let’s copy necessary game files from game DVD first. Insert the DVD, mount it and copy the contents of “Data” folder. To be able to mount the DVD drive you need to have root priviledges. If your DVD drive is auto mounted already, you can skip mounting process.
$ su
password:
Type root password when prompted. Then create the directory for mount point.
$ mkdir /mnt/dvd
Now you can mount the DVD and start copying files. Before start copying the files, you need to be inside cod4 folder in your home folder. Type “cd /home/freelander/games/cod4″ if you’re not there.
$ mount -t iso9660 /dev/dvdrw /mnt/dvd
$ cp -rv /mnt/dvd/Setup/Data/* .
Once copying is finised, you can start with linux files. If you haven’t yet downloaded, download the linux dedicated server files in your cod4 folder.
$ cd /home/freelander/games/cod4
$ wget http://0day.icculus.org/cod/cod4-linux-server-06282008.tar.bz2
After download is completed, extract the package in your cod4 folder.
$ tar -jxvf cod4-linux-server-01312008.tar.bz2
Now you should have the following files as well as the copied game files from the DVD. Make sure that they are all in the same directory as “localization.txt”.
cod4_lnxded
cod4_lnxded-bin
libgcc_s.so.1
libstdc + +. so.6
README.linux
pbsetup.run
Installing Punkbuster
I think it is a good idea to install Punkbuster to stop jerks ruining the gameplay in your server. Simply follow these steps to install Punkbuster. Make sure you are inside cod4 folder.
$ ./pbsetup.run -e
$ ./pbsetup.run --add-game=cod4 --add-game-path=/home/freelander/games/cod4/
$ ./pbsetup.run -u
Configure your server
Before you start your server, you must create a server configuration file. I’ve included a sample server.cfg file here. After making the changes you like, copy it inside “main” folder.
Start your server
I prefer to run the server in a screen. If you do not have screen installed, first install it. (You need to be root to do this)
$ apt-get install screen
After screen is installed, type “exit” to get back to your user account.
So here is a sample server start-up command via screen. First move to your game folder if you’re not there.
$ cd /home/freelander/games/cod4
$ screen -S cod4 ./cod4_lnxded +set sv_pure 1 +set net_port 28960 +set dedicated 2 +set sv_punkbuster 1 +exec server.cfg +map_rotate
Well, that’s it. After server started successfully you can detach screen by hitting Ctrl+A+D. Make sure you have required ports open on your firewall.
Required ports for CoD4
UDP 20800
UDP 20810
UDP 28960
Now you need a good server administration tool which is BigBrotherBot. You can find a step-by-step installation of BigBrotherBot B3 in my other post here.



ShareThis



July 26th, 2010 at 7:18 AM
Great tutorial, you’ve helped me get one step closer to having my server configured … I now get the following at the very end of the server start up message:
Sys_Error: Hunk_FreeTempMemory: bad magic
Any thoughts?
July 26th, 2010 at 8:38 AM
I think I figured it all out, got it running good, so you can, delete my last comment! Thx, again!
July 26th, 2010 at 9:36 AM
You’re welcome! Glad you fixed it
November 16th, 2010 at 9:03 PM
i made all this and every thing is ok .. except i i can’t play on the server because it’ non cracked i need original serial
do you know how to patch it …
November 21st, 2010 at 12:31 AM
Sorry, I don’t provide support for cracked games or servers.
February 28th, 2011 at 6:34 PM
Is it possible somehow to set up the server without the DVD because my server isn’t close to me so I wonder how to set it up? can I simple compy the DATA folder of the CD?
March 1st, 2011 at 10:52 AM
Yes you’ll need to upload the files in Data folder to your remote server.
March 12th, 2011 at 1:29 PM
It Say must run multiuser….. what do i do?
April 16th, 2011 at 7:20 PM
i get an error
Sys_Error: Hunk_FreeTempMemory: bad magic
April 18th, 2011 at 9:44 AM
Pls check your config file. Something maybe wrong there.
April 22nd, 2011 at 11:05 AM
hey i have a dedicated linux server do i have to have the CD to do it or can i do it off a iso image?
April 22nd, 2011 at 11:10 AM
can you make a tutorial on how to do it form a iso image please i dont have acsess to a CD drive please?
April 22nd, 2011 at 11:46 AM
You just need to mount the ISO image in your linux box then copy the files from there. You can Google to find out howto mount an iso image in linux. http://bit.ly/h5XI4s
April 22nd, 2011 at 12:01 PM
thanks
April 22nd, 2011 at 12:10 PM
Will try can you help me out somthing does’nt go right please?
April 22nd, 2011 at 12:13 PM
Will it work if i copy my whole cod folder over to my dedicated server and then follow the tutorial or not? and skip the mounting part or no?
April 22nd, 2011 at 12:44 PM
Once you copy the contents of Data folder from your COD4 CD, you can skip mounting part.
April 24th, 2011 at 4:01 PM
What are the requirements hardware/internet wise for this?
January 22nd, 2012 at 12:02 PM
Hi, i have some problem if i Write ./cod4_lnxded Putty write me No such file or directory [I am in great Folder - Logged as root] Please HELP
April 3rd, 2012 at 4:57 AM
@Krekoun
try this:
apt-get install ia32-libs
April 22nd, 2012 at 9:18 PM
@krekoun
you have to be in you’re game folder and have the linux libs in there
May 17th, 2012 at 3:10 PM
your tutorial helped me a lot
Thanks!