No description
- Shell 76.3%
- Dockerfile 23.7%
| .dockerignore | ||
| .gitlab-ci.yml | ||
| debian-x64-nonroot.Dockerfile | ||
| debian-x64.Dockerfile | ||
| README.md | ||
| start-nonroot.sh | ||
| start.sh | ||
| update.sh | ||
Garry's Mod Docker for MCSManager
Garry's Mod dedicated server for MCSManager with runtime downloads.
Docker Hub: https://hub.docker.com/r/cr8ns/gmod-mcs
Features
- Runtime server download to
/data(MCSManager compatible) - Runs as root for mounted volume compatibility
- SteamCMD at
/home/steam/steamcmd(separate from server files) - Debian Bookworm base (modern, stable)
- x64 server support
- Optional CSS content
- Workshop collection support
- Configurable via environment variables
Quick Start
Pull from Docker Hub:
docker pull cr8ns/gmod-mcs:latest
Or build locally:
docker build -f debian-x64.Dockerfile -t cr8ns/gmod-mcs .
Environment Variables
| Variable | Default | Description |
|---|---|---|
SERVER_DIR |
/data |
Server installation directory |
MAXPLAYERS |
16 |
Maximum players |
GAMEMODE |
sandbox |
Game mode |
MAP |
gm_construct |
Starting map |
PORT |
27015 |
Server port |
TICKRATE |
66 |
Server tickrate |
HOSTNAME |
Garry's Mod Server |
Server name |
RCON_PASSWORD |
`` | RCON password (empty = disabled) |
SV_REGION |
255 |
Server region (255 = world) |
INSTALL_CSS |
true |
Download CSS content |
WORKSHOP_ID |
`` | Workshop collection ID |
WORKSHOP_AUTHKEY |
`` | Workshop auth key |
ARGS |
`` | Additional server arguments |
Usage
MCSManager
MCSManager mounts instance data to /data.
- First run: Downloads server (~5-10 min)
- Restarts: Instant startup, no updates
- Updates: Use
update.shvia terminal or schedule manually
Docker Run
docker run -d \
-v $PWD/server:/data \
-p 27015:27015 \
-p 27015:27015/udp \
-e MAXPLAYERS=32 \
-e GAMEMODE=darkrp \
-e MAP=rp_downtown_v4c_v2 \
-e HOSTNAME="My Server" \
-e RCON_PASSWORD=secret123 \
cr8ns/gmod-mcs:latest
Workshop Collections
docker run -d \
-v $PWD/server:/data \
-p 27015:27015/udp \
-e WORKSHOP_ID=123456789 \
-e WORKSHOP_AUTHKEY=your_key_here \
cr8ns/gmod-mcs:latest
Manual Update
Execute inside running container:
docker exec -it container_name /home/steam/update.sh
Or from host:
docker exec container_name /home/steam/update.sh
Directory Structure
/home/steam/steamcmd/ # SteamCMD (in image)
/data/ # Server files (runtime)
├── srcds_run_x64
├── garrysmod/
│ ├── addons/
│ ├── cfg/
│ └── gamemodes/
└── cstrike/ # Optional CSS content
Persistence
Everything in /data persists:
- Server files
- Addons
- Configs
- Game modes
- Player data
- Logs
Ports
27015/tcp- Game server27015/udp- Game server (main)27005/udp- Server browser/RCON
Region Codes
| Code | Region |
|---|---|
| 0 | US East |
| 1 | US West |
| 2 | South America |
| 3 | Europe |
| 4 | Asia |
| 5 | Australia |
| 6 | Middle East |
| 7 | Africa |
| 255 | World |
Notes
- First startup: 5-10 minutes (server download)
- Subsequent starts: Instant (no auto-update)
- Updates: Manual only via
update.shscript - Disk space: ~5GB for server files
- Container starts as root for MCSManager volume compatibility
- Server process runs as steam user (safe, no warnings)
- SteamCMD commands execute as
steamuser viasu - SteamCMD separate from server for MCSManager compatibility
set -ein scripts exits on any error- CSS content optional via
INSTALL_CSS=false