Garrys Mod
gamesGarrys Mod, is a sandbox physics game created by Garry Newman, and developed by his company, Facepunch Studios.
README
Garry's Mod
Garry's Mod is a physics sandbox. There aren't any predefined aims or goals. We give you the tools and leave you to play.
Docker Images (1)
| Name | Image |
|---|---|
ghcr.io/ptero-eggs/games:source | ghcr.io/ptero-eggs/games:source |
Startup Command
./srcds_run -game garrysmod -console -port {{SERVER_PORT}} +ip 0.0.0.0 +host_workshop_collection {{WORKSHOP_ID}} +map {{SRCDS_MAP}} +gamemode {{GAMEMODE}} -strictportbind -norestart +sv_setsteamaccount {{STEAM_TOKEN}} +maxplayers {{MAX_PLAYERS}} -tickrate {{TICKRATE}} $( [ "$LUA_REFRESH" == "1" ] || printf %s '-disableluarefresh' ) Variables (8)
Map
The default map for the server.
- Environment:
SRCDS_MAP- Default:
gm_flatgrass- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|alpha_dash
Steam Account Token
The Steam Account Token required for the server to be displayed publicly.
- Environment:
STEAM_TOKEN- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|string|alpha_num|size:32
Source AppID
Required for game to update on server restart. Do not modify this.
- Environment:
SRCDS_APPID- Default:
4020- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|in:4020
Workshop ID
The ID of your workshop collection (the numbers at the end of the URL)
- Environment:
WORKSHOP_ID- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|integer
Gamemode
The gamemode of your server.
- Environment:
GAMEMODE- Default:
sandbox- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string
Max Players
The maximum amount of players allowed on your game server.
- Environment:
MAX_PLAYERS- Default:
32- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|max:128
Tickrate
The tickrate defines how fast the server will update each entity's location.
- Environment:
TICKRATE- Default:
22- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|max:100
Lua Refresh
0 = disable Lua refresh, 1 = enable Lua refresh
- Environment:
LUA_REFRESH- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|boolean
Installation Script
Container:
ghcr.io/pterodactyl/installers:debianEntrypoint:
bash#!/bin/bash
# steamcmd Base Installation Script
#
# Server Files: /mnt/server
## just in case someone removed the defaults.
if [ "${STEAM_USER}" == "" ]; then
echo -e "steam user is not set.\n"
echo -e "Using anonymous user.\n"
STEAM_USER=anonymous
STEAM_PASS=""
STEAM_AUTH=""
else
echo -e "user set to ${STEAM_USER}"
fi
## download and install steamcmd
cd /tmp
mkdir -p /mnt/server/steamcmd
curl -sSL -o steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
mkdir -p /mnt/server/steamapps # Fix steamcmd disk write error when this folder is missing
cd /mnt/server/steamcmd
# SteamCMD fails otherwise for some reason, even running as root.
# This is changed at the end of the install process anyways.
chown -R root:root /mnt
export HOME=/mnt/server
## install game using steamcmd
./steamcmd.sh +force_install_dir /mnt/server +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update ${SRCDS_APPID} ${EXTRA_FLAGS} validate +quit ## other flags may be needed depending on install. looking at you cs 1.6
## set up 32 bit libraries
mkdir -p /mnt/server/.steam/sdk32
cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so
## set up 64 bit libraries
mkdir -p /mnt/server/.steam/sdk64
cp -v linux64/steamclient.so ../.steam/sdk64/steamclient.so
# Creating needed default files for the game
cd /mnt/server/garrysmod/lua/autorun/server
echo '
-- Docs: https://wiki.garrysmod.com/page/resource/AddWorkshop
-- Place the ID of the workshop addon you want to be downloaded to people who join your server, not the collection ID
-- Use https://beta.configcreator.com/create/gmod/resources.lua to easily create a list based on your collection ID
resource.AddWorkshop( "" )
' > workshop.lua
cd /mnt/server/garrysmod/cfg
echo '
// Please do not set RCon in here, use the startup parameters.
hostname "New Gmod Server"
sv_password ""
sv_loadingurl ""
sv_downloadurl ""
// Steam Server List Settings
// sv_location "eu"
sv_region "255"
sv_lan "0"
sv_max_queries_sec_global "30000"
sv_max_queries_window "45"
sv_max_queries_sec "5"
// Server Limits
sbox_maxprops 100
sbox_maxragdolls 5
sbox_maxnpcs 10
sbox_maxballoons 10
sbox_maxeffects 10
sbox_maxdynamite 10
sbox_maxlamps 10
sbox_maxthrusters 10
sbox_maxwheels 10
sbox_maxhoverballs 10
sbox_maxvehicles 20
sbox_maxbuttons 10
sbox_maxsents 20
sbox_maxemitters 5
sbox_godmode 0
sbox_noclip 0
// Network Settings - Please keep these set to default.
sv_minrate 75000
sv_maxrate 0
gmod_physiterations 2
net_splitpacket_maxrate 45000
decalfrequency 12
// Execute Ban Files - Please do not edit
exec banned_ip.cfg
exec banned_user.cfg
// Add custom lines under here
' > server.cfg