# IW4x Server Install Guide (Linux)

**URL:** <https://forum.alterware.dev/t/iw4x-server-install-guide-linux/291>\
**Category:** IW4x Server Support\
**Created:** [January 2, 2024, 8:13pm UTC](https://forum.alterware.dev/t/iw4x-server-install-guide-linux/291 "2024-01-02T20:13:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Future](https://forum.alterware.dev/user_avatar/forum.alterware.dev/future/32/207_2.png) [@Future](https://forum.alterware.dev/u/Future)\
**Post date:** [January 2, 2024, 8:13pm UTC](https://forum.alterware.dev/t/iw4x-server-install-guide-linux/291/1 "2024-01-02T20:13:05Z")

</div>

You will need the following:

- Computer or VPS that is online 24/7 with a decent connection that has average or above specs (We strongly advise a VPS).
- Strong technical knowledge/background knowledge of computers and Linux Operating Systems.
- An original copy of the game. You can buy it on Steam @ [Save 25% on Call of Duty®: Modern Warfare® 2 (2009) on Steam](https://store.steampowered.com/app/10180/Call_of_Duty_Modern_Warfare_2_2009/)

**NOTE TO THE READER**

Dear reader,

In the Linux world, when you rent a VPS from a cloud provider, it usually arrives as a “bare” installation lacking most things, including a desktop environment. This means that the initial interaction with your VPS is typically through the terminal via SSH. Before proceeding with this guide, in most cases, you’ll want to install a desktop environment or some other essential programs such as [Vim](https://en.wikipedia.org/wiki/Vim_(text_editor)) for text editing. Additionally, due to lack of time, I only tested this tutorial on Debian and Ubuntu therefore I will show commands using the `apt` package manager. On other Linux distributions or the FreeBSD OS, you might have a different package manager. Refer to the official documentation for your Operating System.

The first attempt may not be easy, especially if you have no prior experience with Linux. _Seriously consider hosting on Windows_, if you prefer a more familiar environment. if you are going to be using Linux for the first time and you attempt to follow this guide you might encounter issues that are very hard to overcome without good general knowledge of your Linux OS.

The way I usually install a desktop environment on my Linux VPS is with the following commands which I include for reference.

```auto
sudo apt-get install xfce4
sudo apt-get install xfce4-goodies
echo xfce4-session >~/.xsession

```

If you installed [UFW](https://en.wikipedia.org/wiki/Uncomplicated_Firewall) on your system make sure to reference the official documentation to allow traffic through the `net_port`. If you do not have it, I still recommend you check your IP tables’ rules to make sure they do not conflict with your IW4x servers. Each server needs an open or forwarded port with at least UDP traffic enabled which we refer to as the net\_port. TCP traffic is optional and needed in case you want to serve content such as mods or user maps to players through the built web server (Mongoose) or if you want to use the game server status page/API.

You may want to check out this other [guide](https://forum.alterware.dev/t/protect-your-iw4x-server-with-fail2ban-linux/301) I made which shows how to harden the security of your IW4x server with [Fail2Ban](https://github.com/fail2ban/fail2ban).

**DOWNLOADING THE GAME** :

I recommend using `steamcmd` to download the game files from the terminal. The following commands will download the Modern Warfare 2 game files from the Steam CDN; ownership of these games is required.

* * *

1. Install `steamcmd` with the following commands

```auto
sudo add-apt-repository multiverse; sudo dpkg --add-architecture i386; sudo apt update
sudo apt install steamcmd

```

* * *

1. Download the SP game files using this `steamcmd +@sSteamCmdForcePlatformType windows +login <STEAMUSERNAME> +force_install_dir ~/server +app_update 10180 validate +quit`

* * *

1. Download MP (Unknown if it is required) files using this (this command may only download a few megabytes) `steamcmd +@sSteamCmdForcePlatformType windows +login <STEAMUSERNAME> +force_install_dir ~/server +app_update 10190 validate +quit`

* * *

By using the commands displayed above you will download the “game files” to a folder called “server”, the folder can be referenced as your game folder throughout this tutorial.

**INSTALLING WINE**

[Wine](https://www.winehq.org/) (originally an acronym for “Wine Is Not an Emulator”) is **a compatibility layer capable of running Windows applications on several POSIX-compliant operating systems** , such as Linux, macOS, & BSD.  
You can install wine on Debian/Ubuntu with `apt-get install wine` (After the installation, you may need to also run in the terminal `winecfg` command to tweak some wine settings). If you are using another operating system or a Linux distro without the apt package manager I suggest you do some Googling to find out how you can install and configure Wine. For IW4x, I recommend also exporting `WINEARCH` to `win32` although I encountered no issue when this environment variable was left untouched or I just set it to `win64`. IW4x _should_ work either way, but if it does not make sure to do this step.

```auto
## Add Variables to the environment at the end of ~/.bashrc
echo -e 'export WINEPREFIX=~/.wine\nexport WINEDEBUG=fixme-all\nexport WINEARCH=win32' >> ~/.bashrc

## Update our session
source ~/.bashrc

## Configure our wine environment
winecfg

```

**SERVER SETUP**

* * *

1. Install the IW4x client distributed by the launcher. [Download](https://github.com/alterware/alterware-launcher/releases) it and place it in your game folder. Note: If you’re on a Debian-based distro, you can skip this step by visiting [[Linux: Debian/Ubuntu AMD64] Install the AlterWare Launcher Using Our APT Repository](https://forum.alterware.dev/t/linux-debian-ubuntu-amd64-arm64-install-the-alterware-launcher-using-our-apt-repository/1117) to install the alterware-launcher via our self-hosted APT repository.

Then run the launcher from your game folder to automatically download the client files. Pro tip: Use the terminal to run the launcher with the `--update` command line argument for updates.

* * *

1. Download the server configurations from our [Git](https://github.com/alterware/IW4ServerConfigsLinux/archive/main.zip), and place the files in the game folder.

* * *

1. Carefully review and edit the configuration settings file to your liking. Give it a hostname, gametype, and remove or add the maps you want, etc. Remember to save the file after you have edited it. If you use the GNU nano text editor, you can consult the manual page to see all the key bindings to use the program efficiently.

* * *

1. Forward the `net_port` (default value: 28960), which is defined in the “start” shell scripts. If you changed the default port or are adding another server, you may need to open the following additional ports. This step is not required on a dedicated server or VPS. If you enabled the firewall, make sure to open the `net_port` for both UDP and TCP traffic. Consult the documentation for [IP Tables](https://help.ubuntu.com/community/IptablesHowTo) or [UFW](https://help.ubuntu.com/community/UFW)

* * *

1. Run the “start” shell script file for the type of server you want, and it will open. You will probably need to give the shell script executable permissions before you run it with `chmod +x <file name>`

* * *

---

<div class="post-metadata">

**Author:** ![Future](https://forum.alterware.dev/user_avatar/forum.alterware.dev/future/32/207_2.png) [@Future](https://forum.alterware.dev/u/Future)\
**Post date:** [January 2, 2024, 9:03pm UTC](https://forum.alterware.dev/t/iw4x-server-install-guide-linux/291/2 "2024-01-02T21:03:37Z")

</div>

Closed on January 2, 2024, 9:03pm UTC



---

<div class="post-metadata">

**Author:** ![Future](https://forum.alterware.dev/user_avatar/forum.alterware.dev/future/32/207_2.png) [@Future](https://forum.alterware.dev/u/Future)\
**Post date:** [January 2, 2024, 9:03pm UTC](https://forum.alterware.dev/t/iw4x-server-install-guide-linux/291/3 "2024-01-02T21:03:41Z")

</div>

Pinned on January 2, 2024, 9:03pm UTC



---

<div class="post-metadata">

**Author:** ![Future](https://forum.alterware.dev/user_avatar/forum.alterware.dev/future/32/207_2.png) [@Future](https://forum.alterware.dev/u/Future)\
**Post date:** [May 27, 2025, 9:30am UTC](https://forum.alterware.dev/t/iw4x-server-install-guide-linux/291/4 "2025-05-27T09:30:04Z")

</div>

> [@\[IW4x\] Shrink your server installation](https://forum.alterware.dev/t/iw4x-shrink-your-server-installation/1960):
>
> If you host a dedicated server on a VPS or a separate computer from the one you normally use to play the client, you can benefit from using this tool: [https://github.com/mxve/shrink-iw4x](https://github.com/mxve/shrink-iw4x) The README contains instructions on how to use the tool. This tool will make the server folder unplayable as a regular client and only allow it to host a dedicated server. Party servers may be untested, so using this tool is not advisable if you plan to host one. The knowledge about shrinking your game files…
