Introduction
This guide will cover the setup of a dedicated server for IW4x for use at your home or more likely a VPS, please note this is for advanced users only. If you are looking for a simply way to play with friends I recommend you check out the Private Match Guide.
There are two main types of servers. There are party servers or match servers, party server act like a traditional steam MW2 lobby, leaving you time to vote for the next map and edit your classes. The other type of server is match, this is the most commonly used type of server and simply rotates map to map without any lobby.
Party Server
- Steam style lobby system.
- Adjust classes and killstreak rewards without leaving the server.
- Vote to skip next map.
- Note: Party servers are very buggy and unstable, they will crash often and even with scripts the server might not properly restart. It is advised to not use party servers and stick to match servers instead!
Match Server
- A normal dedicated server that makes use of a map rotation.
- Rotates map to map with no lobby.
- Stable and the recommended server type to use.
Requirements
- The Visual C++ Redistributable Package
- Visual Code, Notepad++ or Sublime Text - (You may use whatever editor you choose but we don't recommend windows notepad)
- IW4x All-In-One (Dedicated Server Edition) - (Streamlined version of MW2 with textures removed for reduced file size)
[Torrent Download] or [Direct Download]
- Computer or VPS that's online 24/7 with a decent connection that has average or above specs (We strongly advise a VPS)
- IW4MAdmin by RaidMax (Optional but strongly advised administration system)
- Some technical knowledge / background knowledge of computers
Match Server Setup
- Download the IW4x All-In-One Dedicated Server Edition (See Requirements Section) and place it in a location of your choosing on your VPS or PC
- Right click the DedicatedServer.bat file and go to edit with notepad++
- Carefully review/edit the bat file. Game Port LAN Mode.
- Save the file that you just edit.
- Go to your userraw folder. Right click on server.cfg and edit with notepad++
- Carefully review edit the cfg file to your liking.
Give it a hostname, Message of the day, Gametype, remove/add maps that you want on the rotate.
- Save the server.cfg file that you just edit after you done. You can always go back and edit it
- Forward the TCP and UDP port you put in the bat file.
- Run the startserver.bat and now the server should be listed in the serverlist
Party Server Setup
- Download the IW4x All-In-One Dedicated Server Edition (See Requirements Section) and place it in a location of your choosing on your VPS or PC
- Right click the DedicatedLobbyServer.bat file and go to edit with Visual Studio Code or your choice of editor.
- Carefully review/edit the file to your liking, Gamemode, GamePort, LAN Mode.
- Save the file that you just edit after you done. You can always go back and edit it.
- Go to your userraw folder. Right click on partyserver.cfg and edit with Visual Studio Code or your choice of editor.
- Carefully review edit the cfg file to your liking. Give it a hostname, Message of The Day, etc.
- Save the partyserver.cfg file that you just edit.
- On your router, Forward the TCP and UDP port you put in +set net_port "28960" or whatever of your choice. We can't help on this as everyone's routers very different.
- Run the DedicatedLobbyServer.bat and the window should open the name of your server, 0/18 players, none. Ignore any console errors that happen. As long as the server doesn't crash or error out.
- The server should now be listed in the serverlist
Troubleshooting
If you find after setting up your server that you cannot see it on the server list please look over the following:
- If you are hosting the server at Home the usual issue is forgetting to port forward or port forwarding incorrectly. Ensure whatever port you are running your server on (Default=28961) is forwarded on both protocols (UDP & TCP).
It is also worth checking to ensure you have port forwarded to the correct internal IP. You can confirm this using CMD with the command ipconfig /all and looking at the address listed next to IPv4. It is also
strongly advised to use a static IP to prevent your internal IP changing (Saves you having to constantly update port forwarding rules).
- Again if you are hosting at home another issue can be NAT loopback, this prevents you yourself from seeing the server on the list, but anyone else will see it. (It is best to ask a friend to confirm the server is listed / not listed).
- Another portenical issue with home hosting is that your ISP may not support port forwarding, if this is the case we strongly advise to switch to using a VPS as initially suggested.
- Ensure your server console has a map loaded, you can see this from the title bar of the CMD window. If no map is loaded there's a good chance your config is incorrect.
Instructions on how to host another server without conflict
Clone Regular Server
- Go to your userraw folder.
- Right click and copy server.cfg
- Right-click on a blank space inside the userraw folder window and paste.
- Right click on the server - Copy.cfg file rename it to server2.cfg
- Right click on server2.cfg and edit with notepad++
- Carefully edit/review the cfg again. Make sure to change the hostname a little different Also the g_log.
- File and save the new server2.cfg file
- Go back to the main root of your game.
- Copy and Paste DedicatedServer.bat same way you did with cfg file.
- Right click on the DedicatedServer - copy.bat and rename it to DedicatedServer2.bat
- Right click and edit with notepad++
- Change the gameport to a different number. Try 28961
- Go down to where it says set ServerFilename=server.cfg. Rename it to server.cfg to server2.cfg
- Save the DedicatedServer2.bat file
- Make sure to again port forward the new port (28961) with UDP & TCP
- Now run your second iw4x dedicated server. You should now have 2 servers up and running without issues.
Clone Lobby Server
- Go to your userraw folder.
- Right click and copy partyserver.cfg
- Right-click on a blank space inside the userraw folder window and paste.
- Right click on the partyserver - Copy.cfg file rename it to partyserver2.cfg
- Right click on partyserver2.cfg and edit with notepad++
- Carefully edit/review the cfg again. Make sure to change the hostname a little different Also the g_log.
- File and save the new partyserver2.cfg file
- Go back to the main root of your game.
- Copy and Paste LobbyDedicatedServer.bat same way you did with cfg file.
- Right click on the LobbyDedicatedServer - copy.bat and rename it to LobbyDedicatedServer2.bat
- Right click and edit with notepad++
- Change the gameport to a different number. Try 28961
- Go down to where it says set ServerFilename=partyserver.cfg. Rename it to partyserver.cfg to partyserver2.cfg
- Save the LobbyDedicatedServer2.bat file
- Make sure to again port forward the new port (28961) with UDP & TCP
- Now run your second iw4x dedicated server. You should now have 2 servers up and running without issues.
Password protecting a server
Before attempting this you must first ask yourself why you want a publically listed server to have a password. If it's simply to keep it private it would be a much better idea to set sv_lanonly to 1. Doing this will not broadcast your server to the server list,
keeping it private with the benefit of not confusing new users who often ask for server passwords...
Note: If you launched your server already without sv_lanonly it will have been broadcasted to the server list node system, so even you set sv_lanonly the server
will still be public. If this is the case, then use a password as a last resort or as a workaround change the port of your server (It is treated as a different server as far as the node system is concerned).
Permanent Password
- Go to your userraw folder.
- Right click on server.cfg or partyserver.cfg (depending on which mode server you on) and edit with notepad++.
- Go down to where it says g_password ""
- Type in a password you wanted
Temporary Password
- Start your server if you don't have it running
- on the console window type in g_password "123456" (123456 to whatever you want)
- It should work instantly but if not just type in map_restart.
- to open your match with no password without restarting, type in g_password "" with double quotes to disable.
Server Administration Software
There are two main pieces of software available for server administration, that being IW4MAdmin and the other being B3. B3 is no longer actively supported, so IW4MAdmin is the recommended choice.
IW4MAdmin is an administration tool for IW4x, T6M, and most Call of Duty® dedicated servers. It allows complete control of your server; from changing maps, to banning players, IW4MAdmin monitors and records activity on your server(s). With plugin support, extending its functionality is a breeze.
Fast Download Support (FastDL)
Server Configuration
- Open your server.cfg file and add these two dvars
set sv_wwwBaseURL "http://domain.com/iw4x/" or "http://0.0.0.0/iw4x/" // If using an IP and not a domain, put the IP of your server
set sv_wwwDownload "1"
(Replace 0.0.0.0 with your public server IP)
- Access your webservice via FileZilla or any other client
If you do not have a website/domain and want to host these locally, follow the instructions for the Windows Webservice or Linux Webservice.
- Create a "iw4x" directory in the root folder of your hosted website/domain
- Copy your "mods" folder from your IW4x installation into this directory
- Make sure the name of the mod you want to use on your server is named correctly
- Open a web browser of your choice and go to "http://domain.com/iw4x/" or "http://0.0.0.0/iw4x/" (Replace 0.0.0.0 with your public server IP)
Note: If set up correctly you will see a mods folder and it will contain your mod files
The final path should look something like this: "http://0.0.0.0/iw4x/mods/modname/z_mod.iwd
(Replace 0.0.0.0 with your public server IP)
Windows Webservice
If you want to host the files on the same server you host your IW4x game you can follow these steps. You can also alternatively use IIS, we will be providing a tutorial for this shortly.
- Download XAMPP on your windows server
- Install XAMPP
- Open windows advanced firewall
- Click inbound rules
- Click add rule
- Add a new rule by PORT and specify TCP and port 80
- Open XAMPP
- Start the Apache service
- Open your browser and go to the ip address of your windows server If done correctly you will see an XAMPP welcome page
- On the windows server go to C:/xampp/htdocs
Continue from step 3 in the Server Configuration steps
Linux Webservice
If you want to host the files on the same server you host your IW4x game you can follow these steps
- Install web server of your choice (Nginx, Apache, etc)
- For nginx run the command:
sudo apt install nginx
- After nginx is installed run the command:
sudo service nginx start
- Go to /var/www/html/
Continue from step 3 in the Server Configuration steps
Info
- The files you put on the http downloads MUST be the same files that your server is using
- If you get an error saying "Unable to download mod.iwd" when you try to join the server, the files are not in the correct place
General Information
Map Code Names:
BASE GAME:
map mp_afghan (Afgan)
map mp_boneyard (Scrapyard)
map mp_brecourt (Wasteland)
map mp_checkpoint (Karachi)
map mp_derail (Derail)
map mp_estate (Estate)
map mp_favela (Favela)
map mp_highrise (Highrise)
map mp_nightshift (Skidrow)
map mp_invasion (Invasion)
map mp_quarry (Quary)
map mp_rundown (Rundown)
map mp_rust (Rust)
map mp_subbase (Subbase)
map mp_terminal (Terminal)
map mp_underpass (Underpass)
DLC1 STIMULUS:
map mp_complex (Bailout)
map mp_crash (Crash)
map mp_overgrown (Overgrown)
map mp_compact (Salvage)
map mp_storm (Storm)
DLC2 RESURGENCE:
map mp_abandon (Carnival)
map mp_fuel2 (Fuel)
map mp_strike (Strike)
map mp_trailerpark (Trailer Park)
map mp_vacant (Vacant)
DLC3 NUKETOWN:
map mp_nuked (Nuketown)
DLC4 CLASSICS 1:
map mp_cross_fire (Crossfire)
map mp_bloc (Bloc)
map mp_cargoship (Cargoship)
DLC5 CLASSICS 2:
map mp_killhouse (Killhouse)
map mp_bog_sh (Bog)
DLC6 FREIGHTER:
map mp_cargoship_sh (Freighter)
DLC7 RESURRECTION:
map mp_shipment_long (Shipment:Long)
map mp_rust_long (Rust:Long)
map mp_firingrange (Firing Range)
DLC8 RECYCLED:
map mp_storm_spring (Chemical Plant)
map mp_fav_tropical (Tropical: Favela)
map mp_estate_tropical (Tropical: Estate)
map mp_crash_tropical (Tropical: Crash)
map mp_bloc_sh (Forgotten City)
SP MAPS to MP:
map oilrig (Oilrig)
map iw4_credits (IW4_Credits)
map co_hunted (Village)
Gamemodes Code Names:
war (Team Deathmatch)
dm (Free-For-All)
dom (Domination)
koth (Headquarters)
sab (Sabotage)
sd (Search and Destroy)
ctf (Capture the Flag)
dd (Demolition)
oneflag (One-Flag Capture the Flag)
gtnw (Global Thermonuclear War - Cut Content)
arena (Arena - Cut Content)
Want To Learn More?
Check out the official IW4x Wiki, it contains more detailed information in regards to servers such as the API or even setting up a server using a Docker container.
Credits
- Matrix#7801 for the FastDownload section.
- Fry for the base of the guide.
- IW4x team for the Wiki writeup.