Welcome to FPS Gamer

Gaming, Server Administration, Linux

If you play in one of my game servers, do not forget to check your stats here

If you are also interested in games, linux or want to follow my blog, register now not to miss anything!

Member Login

Lost your password?

Registration is closed

Sorry, you are not allowed to register by yourself on this site!

You must either be invited by one of our team member or request an invitation by email at info {at} yoursite {dot} com.

Note: If you are the admin and want to display the register form here, log in to your dashboard, and go to Settings > General and click "Anyone can register".

How to Setup a Call of Duty 4 Server on Debian Linux

Call of Duty 4 Server Setup on Linux

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.

NOTICE: If you are willing to copy/republish this article on your website/blog, please ask for my permission first and note that you cannot make any changes to the content of this article and you must include a live link back to this page as the original article.

22 Responses to “How to Setup a Call of Duty 4 Server on Debian Linux”

  1. Dimas Says:

    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?

  2. Dimas Says:

    I think I figured it all out, got it running good, so you can, delete my last comment! Thx, again!

  3. Freelander Says:

    You’re welcome! Glad you fixed it ;)

  4. murad Says:

    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 …

  5. Freelander Says:

    Sorry, I don’t provide support for cracked games or servers.

  6. BAmse Says:

    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?

  7. Freelander Says:

    Yes you’ll need to upload the files in Data folder to your remote server.

  8. Adil Says:

    It Say must run multiuser….. what do i do?

  9. mattias Says:

    i get an error

    Sys_Error: Hunk_FreeTempMemory: bad magic

  10. Freelander Says:

    Pls check your config file. Something maybe wrong there.

  11. ZC Says:

    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?

  12. ZC Says:

    can you make a tutorial on how to do it form a iso image please i dont have acsess to a CD drive please?

  13. Freelander Says:

    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

  14. ZC Says:

    thanks

  15. ZC Says:

    Will try can you help me out somthing does’nt go right please?

  16. ZC Says:

    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?

  17. Freelander Says:

    Once you copy the contents of Data folder from your COD4 CD, you can skip mounting part.

  18. MozZ Says:

    What are the requirements hardware/internet wise for this?

  19. Krekoun Says:

    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

  20. Fernando Says:

    @Krekoun
    try this:
    apt-get install ia32-libs

  21. michael Says:

    @krekoun
    you have to be in you’re game folder and have the linux libs in there

  22. michael Says:

    your tutorial helped me a lot
    Thanks!

Leave a Reply

*