Installing Your IW4x Dedicated Server on Linux
How to install and run an IW4x dedicated server on Linux using Wine and SteamCMD.
Installing Your IW4x Dedicated Server on Linux
IW4x is a Windows application, but it runs reliably on Linux through Wine. This guide covers the full setup process: installing dependencies, downloading MW2 via SteamCMD, configuring a 32-bit Wine prefix, and creating a launch script. The instructions below target Ubuntu/Debian-based distributions but apply to any distro with minor package name adjustments.
Why Wine?
IW4x's core component (iw4x.dll) is a 32-bit Windows DLL that injects into the MW2 process. There is no native Linux build. Wine provides the Windows runtime environment needed to execute it. The key requirement is a 32-bit Wine prefix — running IW4x under a 64-bit prefix will fail.
Step 1: Install Dependencies
sudo add-apt-repository multiverse
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y steamcmd wine wine32 winetricks
If wine32 isn't available as a standalone package, install wine (which typically pulls in 32-bit support on Ubuntu). Verify you have 32-bit Wine available:
wine --version
Step 2: Configure a 32-bit Wine Prefix
IW4x must run in a 32-bit Wine prefix. Set this up before downloading anything:
export WINEPREFIX=~/.wine_mw2
export WINEARCH=win32
export WINEDEBUG=fixme-all
winecfg
winecfg will open a GUI window to initialize the prefix — you can close it immediately after it finishes. The WINEDEBUG=fixme-all flag suppresses verbose Wine debugging output that would otherwise flood your console.
Install the required Visual C++ runtimes inside the prefix:
WINEPREFIX=~/.wine_mw2 WINEARCH=win32 winetricks vcrun2010 vcrun2019
This downloads and installs the VC++ 2010 and 2015–2019 redistributables automatically.
Step 3: Download MW2 Files via SteamCMD
MW2 requires a paid Steam account, so anonymous SteamCMD login will not work. Replace YOUR_STEAM_USERNAME with your actual Steam account:
steamcmd \
+@sSteamCmdForcePlatformType windows \
+login YOUR_STEAM_USERNAME \
+force_install_dir ~/mw2server \
+app_update 10190 validate \
+quit
The +@sSteamCmdForcePlatformType windows flag tells SteamCMD to download the Windows version of the game files even though you're on Linux — this is required because IW4x needs the Windows binaries.
SteamCMD will prompt for your password and may ask for a Steam Guard code. The download is roughly 7–8 GB.
Step 4: Install IW4x via AlterWare Launcher
Download the Linux build of the AlterWare Launcher from https://github.com/mxve/alterware-launcher/releases. Look for a file named alterware-launcher (no extension) or a Linux-specific asset.
cd ~/mw2server
wget https://github.com/mxve/alterware-launcher/releases/latest/download/alterware-launcher
chmod +x alterware-launcher
./alterware-launcher iw4x --update
This downloads iw4x.dll and supporting files into ~/mw2server/. You should see iw4x.dll in the folder after it completes.
Step 5: Download Server Config Templates
cd ~/mw2server
wget https://github.com/iw4x/iw4-server-configs/archive/refs/heads/main.zip -O iw4-server-configs.zip
unzip iw4-server-configs.zip
cp -r iw4-server-configs-main/* .
rm -rf iw4-server-configs-main iw4-server-configs.zip
This gives you userraw/server.cfg and the reference batch files (ignore the .bat files on Linux — you'll use a shell script instead).
Step 6: Configure server.cfg
Edit ~/mw2server/userraw/server.cfg:
set sv_hostname "My Linux IW4x Server"
set sv_maxclients "18"
set rcon_password "changeme"
set sv_lanonly "0"
set g_log "logs/games_mp.log"
set g_logsync "2"
set logfile "2"
set sv_maprotation "gametype war map mp_rust gametype war map mp_highrise gametype dom map mp_terminal"
Create the logs directory:
mkdir -p ~/mw2server/userraw/logs
Step 7: Create a Launch Script
Create ~/mw2server/start.sh:
#!/bin/bash
export WINEPREFIX=~/.wine_mw2
export WINEDEBUG=fixme-all
cd ~/mw2server
wine iw4x.exe \
-dedicated \
+set fs_game "" \
+set sv_lanonly "0" \
+set net_port "28960" \
+exec server.cfg \
+set party_enable "0" \
+map_rotate
Make it executable:
chmod +x ~/mw2server/start.sh
Step 8: Open the Firewall
Allow the game port through your Linux firewall:
sudo ufw allow 28960/udp
sudo ufw allow 28960/tcp
Step 9: Run the Server
cd ~/mw2server
./start.sh
For a headless server (no display), you may need to run Wine with a virtual framebuffer:
sudo apt install -y xvfb
Xvfb :1 &
export DISPLAY=:1
./start.sh
Alternatively, some Linux server deployments use Wine's wineserver in headless mode without Xvfb — test what works in your environment.
Running as a systemd Service
For automatic startup and restart, create /etc/systemd/system/iw4x.service:
[Unit]
Description=IW4x MW2 Dedicated Server
After=network.target
[Service]
Type=simple
User=gameserver
WorkingDirectory=/home/gameserver/mw2server
ExecStart=/home/gameserver/mw2server/start.sh
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Enable and start it:
sudo systemctl daemon-reload
sudo systemctl enable iw4x
sudo systemctl start iw4x
Common Linux-Specific Issues
| Problem | Solution |
|---|---|
wine: WINEARCH set to win32 but... error |
Delete the existing Wine prefix and re-create it with WINEARCH=win32 |
| Server crashes immediately | Run winetricks vcrun2010 vcrun2019 to install VC++ runtimes |
iw4x.dll not loading |
Ensure the AlterWare Launcher ran successfully and iw4x.dll exists in the server folder |
| Xvfb display errors | Install xvfb and export DISPLAY=:1 before running the server |
| No audio / sound errors in log | Normal on a dedicated server; Wine audio errors can be ignored |