How to create a server (Windows Guide)

I recently set up a server with the help of -MAD_DAD-'s guide, It is straight to the point, but misses some things that I think should be included for new server hosters/People who arent Tech Savvy and its the only complete guide I can find (might be blind). All credit goes to -MAD_DAD- as without his guide, I would’ve faulted. This guide is more lengthy, so if you are Tech Savvy and know how to port forward / setup servers, please follow his instead.

  1. IP/Port. (If using Hamachi/Radmin or anything, just copy IP from that. port forwarding is still recommended/needed. If you cant port forward, try using default 28960, if errors occur, try a different port number.)
    First we need your IP and Port to setup your server to let others join. Open CMD on windows, type ipconfig , look for your ipv4 address. Copy (ctrl+shift+c) and paste into notepad for later.
    Next is port forwarding, It is very misguided that you should use port 28960. DO NOT USE THIS PORT it is common to have issues with this port. Type any random numbers 4-5 chars long but make sure its between 0 and 65535, like 27491 (dont use) and set as TCP/UDP protocol also paste this port in your notepad.

(if you do not know how to port forward, Easiest Way: Find your internet providers phone app, and go through that.

Next Best way: Login through your providers website

Last Option (always works if ISP supports): Open CMD, type “ipconfig” and look for “default gateway” copy and paste the gateway into your browsers search (at the top) and look up what your admin login is for your router (or look for a sticker with login info on the bottom/side of your router). If neither of those work, you will have to contact your provider for further assistance.

Once you get to the Port Forwarding screen ignore anything else and, come back to this, and follow what I said above) In the end, you should have a new port with TDP/UDP on your router/pc.

  1. Server Setup.
    First lets make a new folder for your server, this can be anywhere. In that folder make a “Main” folder. Go to your Cod4 Installation folder, and copy any “IWD” files from there, to your servers “Main” Folder. Now Copy the “Zone” Folder and paste it into your server folder. You will now have 2 folders “Main” and “Zone” inside the servers folder.
    Then we will download the server files for windows. (guide may become out of date, if any issue arises first make sure server files are most recently released V21.2 is current as of 12/1/2023)
    Once the server files are downloaded, open with Winrar/7zip, go into the folders until you see Main/Zone Folder and other loose files. Drag the loose files, into the root directory of your server folder then copy the files inside of the Main/Zone folder from the rar, into the Main/Zone folder of the server. (if asked to overwrite, do so)
    After this has been done, make a shortcut of cod4x18_dederun.exe inside the server folder, we will use this to set “Launch options”.
    Right click the shortcut, click properties, and where Target is. Go all the way right with your arrow key, after the " make a space and Paste whats below with the ipv4 and port set to what is pasted in your notepad from Step 1.

+set dedicated 2 +set net_ip +set net_port 28700 +set modstats 0 +set rcon_password “Password” +set sv_maxclients 32 +exec server.cfg

IMPORTANT: Change the rcon_password, make sure its longer than 6 characters. Its up to you what it is. DO NOT SHARE, AND DO NOT PASTE THIS OR PUT IT ANY CFG FILE, IT STAYS IN THE SHORTCUT!!!

Once this is set, hit apply, if there is an error, make sure it was fully pasted. There is a character limit, so make sure your folders don’t have super long names (ex D:\My Games\Call Of Duty 4 Modern Warfare\Cod Server) try to keep it short.
If it says cannot apply/invalid/something, delete the shortcut, make a new one, and try it again. NOW Run the server once to get needed folders/files generated for later steps. (it wont work, that is fine)

  1. We will now set up the server settings. If you want to do this from scratch (fun but hard) use this template from Cod4x, or you can use mine which is pre-made with default TDM settings. We will now go through some needed / wanted changes.
    Line 15, add a authtoken by going to Cod4x Masterserver List and signing in with your steam account (for security reasons on their end)
    Line 44 sets the server name (what people see it as) DO NOT TOUCH RCON_PASSWORD LEAVE IT BLANK
    Line 48 sets a password if you want the match to be private to yourself/friends.
    Line 208 to change gamemode, if done Line 241 Must be edited as well.
    Once your done editing your cfg, save it in the top left, then close it and rename it to “server.cfg”
    Once that is all done, your folder structure for your server should look like this or very similar

Launch the shortcut, the server should open and run. Once the console stops spamming logs you should see “Gameserver is not VAC Secure!” and following it should be heartbeats from your IP/Port to the masterserver, then following should say “Server is registered on the master server” that should be all! Open Cod4x.

Now open the console with ` (next to 1) and type “connect IP:PORT” (replace ip and port with yours from Step 1) and if you want to have it be private to friends. You can set a password.
Open server.cfg in the Main folder, Line 48 “set g_password " "” put your password inside the parenthesis. Now to connect with a password set use command “connect IP:PORT; password Password” (replace 2nd password)

Any connectivity issues, please try allowing the port through your windows firewall first. Make sure people are able to connect and that the guide was followed 1:1.


If this is not allowed on the forum for some reason, please tell me where I could post this for other new users to easily find!

+set sv_showasranked 1 this option does not work for client 21.1

1 Like

Just curious since you posted this can you explain why?

It usually causes issues with the server (Server wont connect, Friends cant join, Game randomly disconnects) and i’ve seen MAD_DAD say not to use it as well, he seems to be very informed about CoD4x servers so theirs probably underlying issues I dont know of.

Everybody I come across who has issues with their server have used port 28960.

As this is a port used by COD4 anyway I have found that using a different port more often than not cures server creators problems.

I have never used port 28960 for any of my server and have never had an issue.

So that’s my logic behind it, maybe flawed but it has worked for the people I have advised.

Oh and thanks for adding to my guide, I didn’t include details of how to port forward as there are so many router out there that have different ways of doing it that if I said do it this way or do it that way it would have been wrong for them. Plus if you are going down the line of creating your own servers then I would expect you to be a little tech savvy



Also done a guide for setting up a CoD WaW (T4M) server with bots.

Not going to post a link here as it is nothing to do with CoD4x.

If you seek, you will find


1 Like

I did not know that, thanks for the info

1 Like

I run 2 servers on ports 28960 and 28961 since cod4 came out and now cod4x I guess I have been lucky not to get any complaints with the server.
That is why I asked for a reason I guess I will have to check on the servers more often to check for any problems btw they are on ubuntu and I use cod4xwebadmin to monitor the servers


That might be why as it’s always windows servers that have issues with 28960

Thanks MAD_DAD I switched from windows to ubuntu when Neho came out with Cod4xwebadmin since it was made for linux type servers.
I guess switching was not a bad idea for me at the time

I’ve done everything, in the console it says “Couldn’t exec server.cfg”
EDIT: in the cfg file there is a line “set sv_authtoken “”” what do i put in that?

Sorry I completely forgot that part. Go to my profile and go to my Linux guide, there’s a section for that and just follow that really quick.

you have to have the token to put in there go to to request the token However that could not exec server.cfg is another problem that you have to correct first.

hey how are you there? i just tried every step of your guide but in the server log it is giving me following error:
Steam: Server connected successfully
GameServer is not VAC Secure!
GameServer SteamID: [A:1:411678741]
Sending master heartbeat from to
Sending master heartbeat from to resolved to
Resolving cod4master.activision
cod4master.activision resolved to
Masterserver needs token to complete registration
Masterserver needs token to complete registration
Can not register server on the masterserver. Server needs to provide a valid token in cvar sv_authtoken.
Can not register server on the masterserver. Server needs to provide a valid token in cvar sv_authtoken.

i have used your file of server.cfg which i paster in main folder. when i try to connect it is consistently showing me awaiting connection. please if u can help me.

@KutaG59 please if u can help me

Open the server cfg file in the “Main” folder, scroll to line 15, go to this website and get a token, paste that token in the server.cfg file and save changes, relaunch the server and try to connect.
If you still get “awaiting connection” try following this video using your servers port, and TDP/UDP configuration. You should be able to connect after, if not, double check your router is allowing connections.
If you still have issues, add me on discord and ill try to guide you.

That won’t cause the awaiting connection problem you are having. That just lets the server show up in the cod4x list

This is because the server hasn’t loaded a map… adjust your startup command to have the server load a map by adding +map_rotate at the end…

+set dedicated 2 +set net_ip +set net_port 28700 +set modstats 0 +set rcon_password “Password” +set sv_maxclients 32 +exec server.cfg +map_rotate