Docker Setup Configuration - RaidMax/IW4M-Admin GitHub Wiki

Docker Setup for IW4MAdmin

IW4MAdmin organizes and extends your game server administration, providing a powerful web front end, extensive permission system, and numerous plugins. This container packages IW4MAdmin into an easy-to-deploy, configurable server application.

âš ī¸ A Note on Docker Support
To ensure a smooth experience, a basic understanding of Docker concepts is recommended. Our support focuses on the IW4MAdmin application itself. For fundamental Docker questions (like networking or host-specific volume permissions), please refer to the official Docker documentation and community resources.

Application Setup

The IW4MAdmin Docker container is designed to be configured and managed via files on your host system. This is achieved by mounting directories (volumes) from your host into the container.

Initial Setup - A Critical First Step

This container requires a mandatory, user-generated configuration file (IW4MAdminSettings.json) to start. This file is created after you complete the initial interactive setup of a standard IW4MAdmin instance.

  1. If you have never run IW4MAdmin before, you must first run it outside of Docker to complete the initial setup prompts and generate your first IW4MAdminSettings.json.
  2. Once you have this file, you can proceed with the Docker setup.

Docker Deployment

  1. On your Docker host, create a directory structure to store your configuration and data. For example:
    /path/to/your/iw4madmin/
    ├── Configuration/
    ├── Plugins/
    ├── Localization/
    ├── Database/
    └── Log/
    
  2. Place your pre-configured IW4MAdminSettings.json file inside the Configuration folder you just created.
  3. Create a docker-compose.yml file in the /path/to/your/iw4madmin/ directory (see below for the content).
â„šī¸ IMPORTANT: Mount Volumes on First Run!
You must define all the folders you want to manage on the host (Configuration, Database, etc.) in your docker-compose.yml file before you start the container for the first time. If you start the container and then decide to add a volume mount for an existing path like /app/Database, Docker will mount your new empty host folder over the container's internal data, which may result in data loss.

Usage

We recommend using Docker Compose to manage your container, but a docker run command is also provided.

docker compose (recommended)

---
services:
  iw4madmin:
    image: ghcr.io/raidmax/iw4madmin:latest # or :develop
    container_name: iw4madmin
    restart: unless-stopped
    ports:
      # Required for the web front end
      - "1624:1624"
    environment:
      # See below for details on PUID/PGID
      - PUID=0
      - PGID=0
      # Specify your timezone
      - TZ=Europe/London
    volumes:
      # Mount your local folders into the container
      - /path/to/your/iw4madmin/Configuration:/app/Configuration
      - /path/to/your/iw4madmin/Plugins:/app/Plugins
      - /path/to/your/iw4madmin/Localization:/app/Localization
      - /path/to/your/iw4madmin/Database:/app/Database
      - /path/to/your/iw4madmin/Log:/app/Log

After creating the file, start the container by running docker compose up -d in the same directory.

docker cli

docker run -d \
  --name=iw4madmin \
  --restart=unless-stopped \
  -p 1624:1624 \
  -e PUID=0 \
  -e PGID=0 \
  -e TZ=Europe/London \
  -v /path/to/your/iw4madmin/Configuration:/app/Configuration \
  -v /path/to/your/iw4madmin/Plugins:/app/Plugins \
  -v /path/to/your/iw4madmin/Localization:/app/Localization \
  -v /path/to/your/iw4madmin/Database:/app/Database \
  -v /path/to/your/iw4madmin/Log:/app/Log \
  ghcr.io/raidmax/iw4madmin:latest

Network Logging (Advanced) (Optional)

To use network logging, the application must be configured to bind to the container's network interface, and the corresponding port must be exposed on the host.

1. Configure the Application Listener

In IW4MAdminSettings.json, set the ManualLogPath IP to the unspecified IPv4 address, 0.0.0.0. This directs the application to bind its listener to all available network interfaces within the container, which is necessary to receive traffic forwarded by Docker's port mapping.

For example, to listen on port 28990:

    "ManualLogPath": "net.tcp://0.0.0.0:28990",

2. Expose the Host Port

The port must then be mapped from your host to the container in your Docker configuration.

docker compose: Add the TCP port to the ports section.

services:
  iw4madmin:
    #...
    ports:
      - "1624:1624"
      - "28990:28990/tcp" # Add this for Network Logging on port 28990

docker cli: Add another -p flag to your docker run command.

docker run -d \
  # ... other flags
  -p 1624:1624 \
  -p 28990:28990/tcp \ # Add this for Network Logging on port 28990
  # ... other flags
  ghcr.io/raidmax/iw4madmin:latest

Static Outbound IP (for RCON Whitelisting) (Optional)

Some game server configurations or firewalls require you to whitelist the IP address that is allowed to make RCON connections. By default, a Docker container's IP address is dynamic and will change upon recreation. To ensure IW4MAdmin has a predictable IP for whitelisting, you can assign it a static IP address on a custom Docker network. Note, this range/IP may be taken by other containers. I've included an example below.

docker compose: Modify your docker-compose.yml to define the network and assign the static IP to the service.

---
services:
  iw4madmin:
    image: ghcr.io/raidmax/iw4madmin:latest
    container_name: iw4madmin
    restart: unless-stopped
    # ... ports, environment, volumes
    networks:
      iw4m-net:
        ipv4_address: 100.64.10.2 # Assign the static IP here

networks:
  iw4m-net:
    driver: bridge
    ipam:
      config:
        - subnet: 100.64.10.0/30 # Define the network range here
          gateway: 100.64.10.1 # Assign its gateway

You can now use the static IP (100.64.10.2 in this example) in your game server's whitelist.

docker cli: You must first create the Docker network manually, and then add flags to your run command.

  1. Create the network:
    docker network create --subnet=100.64.10.0/30 --gateway=100.64.10.1 iw4m-net
  2. Add the --network and --ip flags to your docker run command:
    docker run -d \
      --name=iw4madmin \
      --network iw4m-net \
      --ip 100.64.10.2 \
      # ... other flags
      ghcr.io/raidmax/iw4madmin:latest

Parameters

Containers are configured using parameters passed at runtime. These parameters are separated by a colon and indicate <host>:<container> respectively.

Ports (-p)

Parameter Function
1624:1624 Web front end access.

Environment Variables (-e)

Env Function
PUID=1000 User ID to run the application as, to avoid permission issues.
PGID=1000 Group ID to run the application as, to avoid permission issues.
TZ=Etc/UTC Specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).

Volume Mappings (-v)

Volume Function
/app/Configuration Stores all IW4MAdmin configuration files. You must provide IW4MAdminSettings.json here.
/app/Plugins Place custom or third-party plugins here.
/app/Localization Place custom or third-party localization files here.
/app/Database Stores the IW4MAdmin SQLite database files.
/app/Log Stores application log files.

User / Group Identifiers

When using volumes, permission issues can arise between the host and the container. We avoid this by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify, and permission issues will be resolved. To find your user's IDs, use the id command:

id your_user

Example output:

uid=1000(your_user) gid=1000(your_user) groups=1000(your_user)

Support Info

  • Shell access whilst the container is running:
    docker exec -it iw4madmin /bin/bash
  • To monitor the logs of the container in realtime:
    docker logs -f iw4madmin
  • Container version number:
    docker inspect -f '{{ index .Config.Labels "org.opencontainers.image.version" }}' iw4madmin

Updating Info

Via Docker Compose

  • Update the image: docker compose pull
  • Update the container: docker compose up -d
  • Remove old images: docker image prune

Via Docker Run

  • Update the image: docker pull ghcr.io/raidmax/iw4madmin:latest
  • Stop and remove the old container:
    docker stop iw4madmin
    docker rm iw4madmin
  • Recreate the container using your original docker run command.
  • Remove old images: docker image prune
âš ī¸ **GitHub.com Fallback** âš ī¸