Return to Castle Wolfenstein Docker Container
This image provides a Dockerized Return to Castle Wolfenstein dedicated server via iortcw suitable for running multiplayer Return to Castle Wolfenstein servers in a clean, reproducible way.
The image is designed for headless operation, supports bind-mounted mods and configuration, and handles legacy runtime dependencies required by Return to Castle Wolfenstein.
Features
- Runs the Return to Castle Wolfenstein dedicated server (
iowolfded.x86_64) - Optionally downloads and extracts mod archives from URLs at startup
- Automated build & push via GitHub Actions
Docker Compose Example
services:
rtcw:
image: lancommander/rtcw:latest
container_name: rtcw-server
# Return to Castle Wolfenstein uses UDP
ports:
- "27960:27960/udp"
# Bind mounts so files appear on the host
volumes:
- ./config:/config
environment:
# Optional: download mods/maps at startup
# EXTRA_MOD_URLS: >
# https://example.com/maps.zip,
# https://example.com/gameplay.pk3
# Optional overrides
# SERVER_ARGS: '+set dedicated 2 +set sv_allowDownload 1 +set sv_dlURL \"\" +set com_hunkmegs 64'
# Ensure container restarts if the server crashes or host reboots
restart: unless-stopped
Directory Layout (Host)
.
└── config/
├── Server/ # Base iortcw install
│ └── main/ # Return to Castle Wolfenstein game files base directory
├── Overlay/ # Files to overlay on game directory (optional)
│ └── main/ # Return to Castle Wolfenstein overlay directory
│ ├── maps/ # Custom maps
│ └── ... # Any other files you want to overlay
├── Merged/ # Overlayfs merged view (auto-created)
├── .overlay-work/ # Overlayfs work directory (auto-created)
├── Scripts/
└── Hooks/ # Script files in this directory get automatically executed if registered to a hook
Both directories must be writable by Docker.
Game Files
You will need to copy the mp_pak*.pk3 files from your retail copy of Return to Castle Wolfenstein into the /config/Server/main directory. The server will not run without these files.
Configuration
An autoexec.cfg file can also be created for adjusting server settings.
Example:
////////////////////////////////////////////////////////////
// Return to Castle Wolfenstein - iortcw Dedicated Server
// autoexec.cfg
////////////////////////////////////////////////////////////
///////////////////////
// Server Identity
///////////////////////
set sv_hostname "^2RTCW ^7Dedicated Server"
set sv_maxclients "20"
set sv_privateClients "0"
set sv_privatePassword ""
///////////////////////
// Network / Master
///////////////////////
set sv_maxRate "25000"
set sv_fps "20"
set sv_timeout "200"
set sv_zombietime "2"
set sv_allowDownload "0"
set dedicated "2" // 2 = Internet, 1 = LAN
set sv_master1 "master.idsoftware.com"
set sv_master2 "master0.gamespy.com"
set sv_master3 ""
set sv_master4 ""
set sv_master5 ""
///////////////////////
// RCON
///////////////////////
set rconPassword "CHANGE_ME_STRONG_PASSWORD"
///////////////////////
// Game Settings
///////////////////////
set g_gametype "2" // 0=SP, 2=Objective, 3=Stopwatch
set timelimit "30"
set fraglimit "0"
set capturelimit "0"
set g_friendlyFire "1"
set g_teamForceBalance "1"
set g_teamAutoJoin "0"
set g_voiceChatsAllowed "1"
set g_noTeamSwitching "0"
set g_antiLag "1"
///////////////////////
// Voting
///////////////////////
set g_allowVote "1"
set voteFlags "0"
set g_voteLimit "5"
///////////////////////
// PunkBuster (if used)
///////////////////////
set sv_punkbuster "0"
///////////////////////
// Logging
///////////////////////
set g_log "games.log"
set g_logSync "1"
set logfile "3"
///////////////////////
// Anti-Flood / Abuse
///////////////////////
set sv_floodProtect "1"
set sv_floodProtectSlow "4"
set sv_floodProtectFast "4"
set sv_floodProtectBurst "8"
///////////////////////
// Download / Redirect
///////////////////////
set sv_wwwDownload "0"
set sv_wwwBaseURL ""
set sv_wwwDlDisconnected "0"
///////////////////////
// Messaging
///////////////////////
set g_motd "^7Welcome to ^2RTCW^7! Respect other players."
set sv_allowAnonymous "0"
///////////////////////
// Map Rotation
///////////////////////
set d1 "map mp_assault; set nextmap vstr d2"
set d2 "map mp_base; set nextmap vstr d3"
set d3 "map mp_castle; set nextmap vstr d4"
set d4 "map mp_depot; set nextmap vstr d5"
set d5 "map mp_village; set nextmap vstr d1"
set nextmap "vstr d1"
///////////////////////
// Execute on Load
///////////////////////
map mp_assault
All gameplay rules, cvars, maps, and RCON settings should live here.
Extra Mod Downloads
Archives provided via EXTRA_MOD_URLS are extracted into /config/Overlay before startup.
Environment Variables
| Variable | Description | Default |
|---|---|---|
EXTRA_MOD_URLS | URLs to download and extract into /config at startup | (empty) |
SERVER_ARGS | Additional Return to Castle Wolfenstein command-line arguments (advanced) | (empty) |
EXTRA_MOD_URLS
A list of URLs separated by commas, spaces, or newlines.
Examples:
EXTRA_MOD_URLS="https://example.com/maps.zip,https://example.com/mod.pk3"
Archives are extracted into /config/Overlay. Single files are copied as-is.
Match Statistics
The server can report the matches played on it to LANCommander, with the
LANCommander match statistics plugin.
The plugin runs in QMM2, and both are built into the image. They are
turned on when MATCH_STATS_SERVER_URL and MATCH_STATS_TOKEN are set. QMM2 then takes the place of the game
module, main/qagame.mp.x86_64.so, and loads the game's own module (kept as qmm_qagame.mp.x86_64.so) and the plugin. Turned off, the
game's own module is put back.
| Variable | Description | Default |
|---|---|---|
MATCH_STATS_ENABLED | auto: on when MATCH_STATS_SERVER_URL and MATCH_STATS_TOKEN are set. true or false | auto |
MATCH_STATS_SERVER_URL | The LANCommander server, e.g. http://lancommander.lan:1337. Only http:// works on Linux | (empty) |
MATCH_STATS_TOKEN | A LANCommander access token with the Report matches scope (Profile → Access Tokens). It isn't written to any file | (empty) |
MATCH_STATS_GAME_ID | The game's id in LANCommander | (empty) |
MATCH_STATS_SERVER_ID | This server's id in LANCommander, if LANCommander manages it | (empty) |
MATCH_STATS_MIN_PLAYERS | Human players needed before a match is recorded | (1) |
MATCH_STATS_RECORD_BOTS | Record bots as players (true/false) | (true) |
MATCH_STATS_RECORD_CHAT | Record chat messages (true/false) | (false) |
QMM_MOD_DIR | The folder of the mod the server runs (its fs_game) | main |
QMM_PLUGINS | More QMM2 plugins to load, comma-separated, relative to QMM_MOD_DIR | (empty) |
The settings are written to main/lancommander_qmm.cfg as lc_* cvars on every start, and QMM2 execs it once
the plugin has loaded. Settings left empty aren't written, so they and the plugin's other lc_* cvars (see its
README) can be set in server.cfg instead, with set. A qmm2.json you put in Overlay/main/ yourself is
left alone.
+set vm_game 0 is added to the command line, and QMM2 runs iortcw's native qagame.mp.x86_64.so (QMM_MOD). iortcw runs its vm/qagame.mp.qvm by default, but QMM2 crashes the server running it.
lc_status on the server console or over RCON shows the match being recorded and how delivery is going. Reports
that couldn't be delivered yet are kept in Overlay/main/qmmaddons/lancommander/.interposer/Matches/ and sent
once LANCommander can be reached.
Running the Server
Basic run (recommended)
mkdir -p config
docker run --rm -it \
-p 27960:27960/udp \
-v "$(pwd)/config:/config" \
lancommander/rtcw:latest
With automatic mod downloads
docker run --rm -it
-p 27960:27960/udp
-v "$(pwd)/config:/config"
-e EXTRA_MOD_URLS="https://example.com/modpack.zip"
lancommander/rtcw:latest
Ports
- UDP 27960 – default Return to Castle Wolfenstein server port
License
iortcw is distributed under its own license. This image contains only Docker build logic and helper scripts licensed under MIT.