{"id":13599597,"url":"https://github.com/MisterCalvin/swat4-server-docker","last_synced_at":"2025-04-10T13:30:47.826Z","repository":{"id":178731940,"uuid":"662286727","full_name":"MisterCalvin/swat4-server-docker","owner":"MisterCalvin","description":"SWAT 4 Dedicated server running inside a Docker container (with mod support)","archived":false,"fork":false,"pushed_at":"2024-06-24T17:10:00.000Z","size":39,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T03:35:40.126Z","etag":null,"topics":["dedicated-server","docker","game-server","swat4","wine"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MisterCalvin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-04T19:29:45.000Z","updated_at":"2025-03-15T21:41:15.000Z","dependencies_parsed_at":"2024-06-24T18:28:14.701Z","dependency_job_id":"18eb9f7c-ef9c-44f8-9ae7-7e0fe4370fe0","html_url":"https://github.com/MisterCalvin/swat4-server-docker","commit_stats":null,"previous_names":["mistercalvin/docker-swat4","mistercalvin/swat4-server-docker"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisterCalvin%2Fswat4-server-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisterCalvin%2Fswat4-server-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisterCalvin%2Fswat4-server-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisterCalvin%2Fswat4-server-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MisterCalvin","download_url":"https://codeload.github.com/MisterCalvin/swat4-server-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225707,"owners_count":21068078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dedicated-server","docker","game-server","swat4","wine"],"created_at":"2024-08-01T17:01:07.502Z","updated_at":"2025-04-10T13:30:47.798Z","avatar_url":"https://github.com/MisterCalvin.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# SWAT 4 Dedicated Server in Docker\nA Docker container running a SWAT 4 Dedicated Server under Wine, built on Alpine. This container supports mods, see the docker compose or docker cli commands below for information on how to enable them. Your game directory (mounted in the container as `/container/swat4`) should be structured as follows:\n\n    .\n    ├── ...\n    ├── Content\n    ├── ContentExpansion\n    ├── YourMod1\n    └── YourMod2\n\nThe container is built with the Master Server Patches necessary for listing your game on the community server list, it will check your `Content/` and `ContentExpansion/` folder for their existence at each startup and automatically replace them if are they are not the correct files. You can find the the patches \u003ca href=\"https://github.com/sergeii/swat-patches/tree/master/swat4stats-masterserver/\" target=\"_blank\"\u003ehere\u003c/a\u003e.\n\n### docker compose\n\n```\nservices: \n  swat4-server-docker: \n    image: ghcr.io/mistercalvin/swat4-server-docker:latest\n    container_name: swat4-server-docker\n    environment: \n      TZ: America/New_York\n      PUID: 1000 # Optional: Set the UID for the user inside the container; Default: 1000\n      PGID: 1000 # Optional: Set the GID for the user inside the container; Default: 1000\n      CONTENT_VERSION: SWAT4 # Required: Choose SWAT4, TSS, or enter the name of your mod folder (case-sensitive); Default: SWAT4\n      SERVER_NAME: A SWAT 4 Docker Server # Required: Name of the Server; Default: A SWAT4 Docker Server\n      SERVER_PASSWORD: # Optional: Password for the Server (alphanumeric characters only); Default: unset\n      GAME_TYPE: 2 # Required: Choose Barricaded Suspects (1), CO-OP (2), Rapid Deployment (3), Smash and Grab (4), or VIP Escort (5); Default: CO-OP\n      LAN_ONLY: False # Optional: If True, the server is hosted only over the LAN (not internet); Default: False\n      SERVER_MAPLIST: \"SP-FairfaxResidence,SP-Foodwall,SP-Hospital\" # Required: Comma-separated list of map names, without extension; Default: SP-FairfaxResidence,SP-Foodwall,SP-Hospital\n      MAX_PLAYERS: 10 # Optional: Maximum amount of players for the server; Default: 10\n      ADMIN_PASSWORD: # Optional: Admin password for in-game administration (alphanumeric characters only); Default: unset\n      NUM_ROUNDS: 15 # Optional: Number of rounds for each match; Default: 15\n      ROUND_TIME_LIMIT: 900 # Optional: Time limit (in seconds) for each round (0 - No Time Limit); Default: 900\n      DEATH_LIMIT: 50 # Optional:  How many deaths are required to lose a round (0 - No Death Limit); Default: 50\n      MP_MISSION_READY_TIME: 90 # Optional: Time (in seconds) for players to ready themselves in between rounds in a MP game; Default: 90\n      POST_GAME_TIME_LIMIT: 15 # Optional: Time (in seconds) between the end of the round and server loading the next level; Default: 15\n      QUICK_ROUND_RESET: False # Optional: If true, the server will perform a quick reset in between rounds on the same map, if false, the server will do a full SwitchLevel between rounds; Default: False\n      ADDITIONAL_ARGS: # Optional: Comma-separated list of additional arguments to modify; Default: unset\n    volumes: \n      - /path/to/your/gamefile:/container/swat4\n      - swat4-wine:/container/.wine\n    ports: \n      - 10480-10483:10480-10483/udp\n    restart: unless-stopped\n\nvolumes:\n  swat4-wine:\n    name: swat4-wine\n```\n\n### docker cli\nCreate a named volume before executing the command below: `docker volume create swat4-wine` (this will persist your .wine directory, allowing for quicker server startup times)\n\n```\ndocker run -d \\\n  --name=swat4-server-docker \\\n  -e PUID=\"1000\" \\\n  -e PGID=\"1000\" \\\n  -e TZ=\"America/New_York\" \\\n  -e CONTENT_VERSION=\"SWAT4\" \\\n  -e SERVER_NAME=\"A SWAT 4 Docker Server\" \\\n  -e SERVER_PASSWORD=\"\" \\\n  -e GAME_TYPE=\"CO-OP\" \\\n  -e SERVER_MAPLIST=\"SP-FairfaxResidence,SP-Foodwall,SP-Hospital\" \\\n  -e LAN_ONLY=\"False\" \\\n  -e MAX_PLAYERS=\"10\" \\\n  -e ADMIN_PASSWORD=\"\" \\\n  -e NUM_ROUNDS=\"15\" \\\n  -e ROUND_TIME_LIMIT=\"900\" \\\n  -e DEATH_LIMIT=\"50\" \\\n  -e MP_MISSION_READY_TIME=\"90\" \\\n  -e POST_GAME_TIME_LIMIT=\"15\" \\\n  -e QUICK_ROUND_RESET=\"False\" \\\n  -e ADDITIONAL_ARGS=\"\" \\\n  -p 10480-10483:10480-10483/udp \\\n  -v /path/to/gamefiles/:/container/swat4 \\\n  -v swat4-wine:/container/.wine \\\n  --restart unless-stopped \\\n  ghcr.io/mistercalvin/swat4-server-docker:latest\n```\n  \n## Server Ports\nSWAT 4 requires Join Port + 3 (Default port is 10480, so 10480-10483/udp)\n\n| Port      | Default  |\n|-----------|----------|\n| Join \t\t| 10480/udp|\n| Query     | 10481/udp|\n|        \t| 10482/udp|\n|       \t| 10483/udp|\n\n## Useful Information\n#### \u003csup\u003e1\u003c/sup\u003e Changing Server Text Color in Server Browser\n\u003e You use the hexidecimal color number. For example in Swatguistate.ini under [SwatGame.ServerSettings] in the line for ServerName=, add the [c=00ff00] in front of your server name to make your server name appear green in the ingame Browser. Yellow would be ffff00, blue is 0000ff, and red is ff0000. You can use different shades by finding the corresponding hex color number you want from just about any graphics program that supports hexidecimal color numbers such as photoshop or paintshop pro. Likewise for underline you would add a [u] infront of the section you want to underline.\n\u003cbr\u003e\u003cbr\u003e\nThe downside of this is that ingame when you hit esc to see the scores or mission status, your server name will not show the color but will show the brackets and color code infront of your server name. Like this: \"[c=00ff00][u]Fatality Inc. Coop 1\". If that doesn't bother you then run with the colors.\n\nTo customize your server name color you can add the blocks to your `SERVER_NAME` variable:\n\n```\nSERVER_NAME=\"[c=0000ff][u][b]A SWAT 4 Docker Server[\\u][\\b]\"\n```\n\n#### \u003csup\u003e2\u003c/sup\u003e Quick Round Reset\n\u003e Quick Round Reset: If number of rounds is set to more than one, this setting will start the new round on the same map without reloading. This saves on loading time but all interactive elements of a level, such as open doors and broken windows, will remain in the same state as the previous round.\n\n#### Using ADDITIONAL_ARGS\nMost common options such as Server name, password, admin password, etc., have been exposed as environment variables for convenience. If you would like to modify an option not exposed, you can use ADDITIONAL_ARGS. For example, if you wanted to disable showing teammate names and disable respawns, you would add the following to your docker-compose.yml or docker run command:\n\n```\nADDITIONAL_ARGS=\"bShowTeammateNames=False,bNoRespawn=True\"\n```\n\nFor a list other options, take a look at your `SwatGUIState.ini`, located in `GAME_DIR/System/`.  \n\n\u003csup\u003e1\u003c/sup\u003e \u003ca href=\"https://sasclan.org/forum-topic/swat-4-server-administration-3550\" target=\"_blank\"\u003eSWAT 4 Server administration\u003c/a\u003e  \n\u003csup\u003e2\u003c/sup\u003e \u003ca href=\"https://sierrachest.com/index.php?a=games\u0026id=74\u0026title=swat-4\u0026fld=walkthrough\u0026pid=13#:~:text=Quick%20Round%20Reset%3A%20If%20number,state%20as%20the%20previous%20round.\" target=\"_blank\"\u003eThe Sierra Chest\u003c/a\u003e  \n## User / Group Identifiers\nYou can specify the UID \u0026 GID for the user (app) inside the container, see \u003ca href=\"https://github.com/jlesage/docker-baseimage-gui#usergroup-ids\" target=\"_blank\"\u003ethis page\u003c/a\u003e for more information.\n\nPlease note this does not change file permissions on the mounted volume (`/container/swat4`), it only changes the default container users (`wine`) UID/GID to the specified value. Make sure proper permissions are applied to the game files directory on the host (SWAT 4 in particular requires write permissions to create a log file and a blank Running.ini to the `/System` folder at runtime).\n\n## Notes / Bugs\n- I tested this to the best of my abilities, however SWAT 4 is a buggy game and I am sure there are some things I missed. If you have any problems feel free to [open a new issue](../../issues).\n\n- Mods are supported, however they will not respect the `ADMIN_PASSWORD` env variable. For setting up in-game administration on a server running a mod you will need to consult with the developers documentation.\n\n- Mods may also have additional features or options you can configure, you will need to manually edit the SwatGUIState.ini file found within your mods `System/` folder if you wish to modify anything. The startup script is designed to only overwrite the env variables listed in the Dockerfile, everything else will be untouched.\n\n- I have tested the container with the following mods:\n\n| Mod       \t\t\t| Version  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n|-----------------------|---------------------------------------------------------------------------------------------------|\n| SWAT: Elite Force     | \u003ca href=\"https://www.moddb.com/mods/swat-elite-force/downloads/swat-elite-force-v7\" target=\"_blank\"\u003e7\u003c/a\u003e\t\t\t\t\t|\n| SEF First Responders \t\t| \u003ca href=\"https://www.moddb.com/mods/sef-first-responders/downloads/sef-first-responders-v067-stable\" target=\"_blank\"\u003e0.67 Stable\u003c/a\u003e\t|\n| SWAT: Back to LA \t\t| \u003ca href=\"https://www.moddb.com/mods/swat-back-to-los-angeles/downloads/sef-back-to-los-angeles-v16\" target=\"_blank\"\u003e1.6\u003c/a\u003e\t|\n| Canadian Forces: Direct Action | \u003ca href=\"https://www.moddb.com/downloads/canadian-forces-direct-action-41\" target=\"_blank\"\u003e4.1\u003c/a\u003e\t\t\t\t\t|\n| 11-99 Enhancement \t| \u003ca href=\"https://www.moddb.com/mods/11-99-enhancement-mod/downloads/11-99-enhancement-mod-v13\" target=\"_blank\"\u003e1.3\u003c/a\u003e\t\t|\n\n## Building\nIf you intend to build the Dockerfile yourself, I have not pinned the packages as Alpine does not keep old packages. At the time of writing (2024/06/24) I have built and tested the container with the following package versions:\n\n| Package   \t\t\t               | Version      |\n| ------------------------------ | ------------ |\n| alpine                         | 3.20.1       |\n| wine (**i386 only**)           | 9.0-r0       |\n| hangover-wine (**arm64 only**) | 9.5-r0       |\n| bash                           | 5.2.26-r0    |\n| tzdata                         | 2024a-r1     |\n| shadow                         | 4.15.1-r0    |\n| wget                           | 1.36.1       |\n| figlet                         | 2.2.5-r3     |\n| xvfb-run                       | 1.20.10.3-r2 |\n| findutils                      | 4.9.0-r5     |\n| s6-overlay                     | 3.1.6.2      |\n\n## ARM64 Support\nThis container has been adapted for use on ARM64 processors by utilizing the project \u003ca href=\"https://github.com/AndreRH/hangover\" target=\"_blank\"\u003eAndreRH/hangover\u003c/a\u003e. ARM64 support is experimental and was only tested on a Raspberry Pi 4, you may experience additional bugs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMisterCalvin%2Fswat4-server-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMisterCalvin%2Fswat4-server-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMisterCalvin%2Fswat4-server-docker/lists"}