Garry's Mod, a sandbox game developed by Facepunch Studios and published by Valve in 2006, offers players an open world to manipulate objects without set objectives. Additional game modes like Trouble in Terrorist Town and Prop Hunt, created by other developers as mods, can be added through platforms like the Steam Workshop. This Docker image contains the dedicated server of the game.
Running a Garry's Mod dedicated server
- Run using a bind mount for data persistence on container recreation. Replace the following fields before executing the command:
$ mkdir -p $(pwd)/gm-data
$ chmod 777 $(pwd)/gm-data # Makes sure the directory is writeable by the unprivileged container user
$ docker run -d --net=host \
-v $(pwd)/gm-data:/home/steam/gm-dedicated/ \
--name=gm-dedicated jcivitell/garrysmod
The container will automatically update the game on startup, so if there is a game update just restart the container.
Feel free to overwrite these environment variables, using -e (--env):
GM_SERVERNAME="changeme" (Set the visible name for your private server)
GM_PORT=27015 (GM server listen port tcp_udp)
GM_PW="changeme" (GM server password)
GM_MAXPLAYERS=10 (Max Players)
GM_GAMEMODE="terrortown" (Set the Gamemode to terrortown)
GM_WORKSHOP="" (Option to load a workshop collection)
GM_MAP="" (Option to set start map)
GM_LOCATION=eu (Country Flag)
GM_STEAMTOKEN="changeme" (GSLT-Key https://steamcommunity.com/dev/managegameservers)