|
| 1 | +# Unreal Tournament 2004 Dedicated Server (Docker) |
| 2 | + |
| 3 | +This repository provides a Dockerized **Unreal Tournament 2004 dedicated server** suitable for running multiplayer UT2004 servers in a clean, reproducible way. |
| 4 | +The image is designed for **headless operation**, automatically downloads game assets on first startup, and supports bind-mounted configuration files. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## Features |
| 9 | + |
| 10 | +- Runs the **Unreal Tournament 2004 dedicated server** (`ucc-bin`) |
| 11 | +- Automatically downloads and extracts game assets on first startup |
| 12 | +- Tracks downloaded assets to prevent re-downloading on container restarts |
| 13 | +- Non-root runtime using `gosu` |
| 14 | +- Supports custom server configuration files |
| 15 | + |
| 16 | +## Docker Compose Example |
| 17 | +```yaml |
| 18 | +services: |
| 19 | + ut2004: |
| 20 | + image: lancommander/ut2004:latest |
| 21 | + container_name: ut2004-server |
| 22 | + |
| 23 | + # UT2004 uses UDP for game, query, and beacon ports |
| 24 | + ports: |
| 25 | + - "7777:7777/udp" # Game port |
| 26 | + - "7778:7778/udp" # Query port |
| 27 | + - "7779:7779/udp" # Beacon port |
| 28 | + |
| 29 | + # Bind mounts so files appear on the host |
| 30 | + volumes: |
| 31 | + - ./config:/config |
| 32 | + |
| 33 | + environment: |
| 34 | + # Optional overrides |
| 35 | + # SERVER_PORT: 7777 |
| 36 | + # SERVER_ARGS: 'CTF-Face?Game=XGame.xCTFGame?MaxPlayers=16' |
| 37 | + |
| 38 | + # Ensure container restarts if the server crashes or host reboots |
| 39 | + restart: unless-stopped |
| 40 | +``` |
| 41 | +
|
| 42 | +--- |
| 43 | +
|
| 44 | +## Directory Layout (Host) |
| 45 | +
|
| 46 | +```text |
| 47 | +. |
| 48 | +├── config/ |
| 49 | +│ ├── ut-server/ # Game assets (auto-downloaded on first startup) |
| 50 | +│ │ ├── ucc-bin |
| 51 | +│ │ ├── System/ |
| 52 | +│ │ └── ... |
| 53 | +│ ├── .assets-downloaded # Marker file to track downloads |
| 54 | +│ ├── UT2004.ini |
| 55 | +│ ├── Default.ini |
| 56 | +│ └── User.ini |
| 57 | +``` |
| 58 | + |
| 59 | +The `config` directory **must be writable** by Docker. The `ut-server` directory and its contents are automatically downloaded and extracted on first startup. |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## Configuration |
| 64 | + |
| 65 | +UT2004 server configuration files should be placed in `/config`: |
| 66 | + |
| 67 | +- `UT2004.ini` - Main server configuration |
| 68 | +- `Default.ini` - Default game settings |
| 69 | +- `User.ini` - User-specific settings |
| 70 | + |
| 71 | +The server will use these configuration files if they exist. You can customize server settings, game modes, maps, and other options in these files. |
| 72 | + |
| 73 | +Example server configuration in `UT2004.ini`: |
| 74 | +```ini |
| 75 | +[Engine.GameInfo] |
| 76 | +ServerName=My UT2004 Server |
| 77 | +MaxPlayers=16 |
| 78 | +GamePassword= |
| 79 | +AdminPassword=changeme |
| 80 | +``` |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## Environment Variables |
| 85 | + |
| 86 | +| Variable | Description | Default | |
| 87 | +|--------|-------------|---------| |
| 88 | +| `SERVER_PORT` | UDP port the server listens on (game port) | `7777` | |
| 89 | +| `SERVER_ARGS` | Map and game type arguments (see below) | *(empty - uses default: DM-Rankin)* | |
| 90 | +| `UT2004_DOWNLOAD_URL` | URL to download game assets from | `https://s3.amazonaws.com/ut2004-files/dedicated-server-3339-bonuspack.tar.gz` | |
| 91 | + |
| 92 | +### `SERVER_ARGS` |
| 93 | + |
| 94 | +If `SERVER_ARGS` is not set, the server will use the default map `DM-Rankin` with DeathMatch game type. |
| 95 | + |
| 96 | +To customize the map and game type, set `SERVER_ARGS` with the map name and options. The format is: `<MapName>?Game=<GameType>?<Options>` |
| 97 | + |
| 98 | +Common examples: |
| 99 | + |
| 100 | +```bash |
| 101 | +# Capture the Flag on Face map |
| 102 | +SERVER_ARGS="CTF-Face?Game=XGame.xCTFGame?MaxPlayers=16" |
| 103 | + |
| 104 | +# DeathMatch on Rankin map (default) |
| 105 | +SERVER_ARGS="DM-Rankin?Game=XGame.xDeathMatch?MaxPlayers=8" |
| 106 | + |
| 107 | +# Team DeathMatch |
| 108 | +SERVER_ARGS="DM-Rankin?Game=XGame.xTeamGame?MaxPlayers=16" |
| 109 | + |
| 110 | +# Onslaught mode |
| 111 | +SERVER_ARGS="ONS-Torlan?Game=Onslaught.ONSOnslaughtGame?MaxPlayers=16" |
| 112 | +``` |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +## Running the Server |
| 117 | +### Basic run (recommended) |
| 118 | +```bash |
| 119 | +mkdir -p config |
| 120 | +chmod -R 777 config |
| 121 | + |
| 122 | +docker run --rm -it \ |
| 123 | + -p 7777:7777/udp \ |
| 124 | + -p 7778:7778/udp \ |
| 125 | + -p 7779:7779/udp \ |
| 126 | + -v "$(pwd)/config:/config" \ |
| 127 | + lancommander/ut2004:latest |
| 128 | +``` |
| 129 | + |
| 130 | +### With custom server arguments |
| 131 | +```bash |
| 132 | +docker run --rm -it \ |
| 133 | + -p 7777:7777/udp \ |
| 134 | + -p 7778:7778/udp \ |
| 135 | + -p 7779:7779/udp \ |
| 136 | + -v "$(pwd)/config:/config" \ |
| 137 | + -e SERVER_ARGS="CTF-Face?Game=XGame.xCTFGame?MaxPlayers=16" \ |
| 138 | + lancommander/ut2004:latest |
| 139 | +``` |
| 140 | + |
| 141 | +## Ports |
| 142 | +- **UDP 7777** – Game port (default) |
| 143 | +- **UDP 7778** – Query port (for server browser) |
| 144 | +- **UDP 7779** – Beacon port (for server discovery) |
| 145 | + |
| 146 | +## Asset Download |
| 147 | + |
| 148 | +On first startup, the container will automatically download the UT2004 dedicated server assets from the configured URL. The download is tracked using a marker file, so subsequent container restarts will skip the download if the assets are already present. |
| 149 | + |
| 150 | +## License |
| 151 | +Unreal Tournament 2004 is distributed under its own license. |
| 152 | +This repository contains only Docker build logic and helper scripts licensed under MIT. |
0 commit comments