Game Server Maker - Launch game servers on AWS EC2 with Docker
Project description
_____ _____ __ __ _____
/ ____|/ ____| \/ |/ ____|
| | __| (___ | \ / | |
| | |_ |\___ \| |\/| | |
| |__| |____) | | | | |____
\_____|_____/|_| |_|\_____|
Game Server Maker
Launch game servers on AWS in one command. No console clicking. No YAML files. No Terraform.
⚡ Features
- One-command launch —
gsmc launch factorio -n my-serverprovisions EC2, installs Docker, opens ports, and starts your server - 130+ games — Built-in Docker games + 130+ via LinuxGSM integration
- Pause & resume — stop paying while you're not playing, pick up where you left off
- Snapshots & cloning — back up your world or clone a server from a snapshot
- Elastic IPs — pin a static address that survives pause/resume cycles
- Full CLI + REST API — manage from the terminal or run the optional FastAPI server
🚀 Quick Start
Setting up a game server sucks. You need an EC2 instance, Docker, security groups, port mappings, SSH keys, config files... or you could just:
1. Install
pipx install gsmc # recommended
uv tool install gsmc # if you use uv
pip install gsmc # in a virtual environment
2. Configure AWS — set up credentials (docs) and apply the minimum IAM policy.
3. Launch
gsmc launch factorio -n my-server
4. Play — then manage the lifecycle:
gsmc list # see your servers
gsmc logs my-server # check the output
gsmc rcon my-server /save # send an RCON command
gsmc pause my-server # stop paying, keep data
gsmc resume my-server # pick up where you left off
gsmc pin my-server # static IP across restarts
gsmc snapshot my-server # back up the world
gsmc destroy my-server # tear it down
🎮 Supported Games
LinuxGSM games (130+)
gsmc integrates with LinuxGSM to support 130+ game servers. LinuxGSM games use a config-driven format — gsmc generates game definitions from upstream LinuxGSM data, each represented as a Python dataclass with ports, default settings, and instance sizing.
| Game | CLI name |
|---|---|
| Garry's Mod | lgsm-gmod |
| ARK: Survival Evolved | lgsm-arkse |
| Counter-Strike 2 | lgsm-cs2 |
| Team Fortress 2 | lgsm-tf2 |
| Rust | lgsm-rust |
| 7 Days to Die | lgsm-7dtd |
| DayZ | lgsm-dayz |
| Project Zomboid | lgsm-pz |
| Palworld | lgsm-pw |
Run gsmc games to see the full list, or gsmc sync --list to browse all available LinuxGSM servers.
Docker games (built-in)
These are hand-written game definitions that use community Docker images directly:
| Game | CLI name | Default instance | Approx. cost/hr |
|---|---|---|---|
| Factorio | factorio |
t3.medium | ~$0.04 |
Adding your own game
Both LinuxGSM and Docker games are Python dataclasses in src/gsm/games/. To add a new Docker game, create a new file with a GameDefinition and call register_game(). To add a LinuxGSM game, use gsmc sync --add <server_code>. See CONTRIBUTING.md for details.
📖 Usage Examples
# Factorio with default settings
gsmc launch factorio -n my-factory
# Docker game with a config file
gsmc config factorio --init -o factorio.cfg
# edit factorio.cfg...
gsmc launch factorio --config-file factorio.cfg
# LinuxGSM game with a config file
gsmc config lgsm-rust --init -o rust.cfg
# edit rust.cfg...
gsmc launch lgsm-rust --config-file rust.cfg
# Inline config (any game)
gsmc launch lgsm-gmod -c maxplayers=32 -c servername="My Server"
gsmc launch factorio -c GENERATE_NEW_SAVE=false
# Launch with a static IP that survives pause/resume
gsmc launch factorio --pin-ip -n persistent-server
# Clone a server from a snapshot
gsmc snapshot my-server
gsmc launch factorio --from-snapshot snap-abc123 -n my-server-clone
# Upload a file before launch
gsmc launch factorio -u ./saves/my-save.zip:/factorio/saves/my-save.zip
⚙️ Configuration Guide
Every game server has settings you'll want to tweak — player count, server name, passwords, world options, etc. gsmc gives you gsmc config to discover what's available, and flags on gsmc launch to set them.
All games are configured with -c KEY=VALUE on launch. Use gsmc config <game> to see what options are available.
# See what a game supports
gsmc config factorio
gsmc config lgsm-rust
# Override settings at launch (any game)
gsmc launch factorio -c GENERATE_NEW_SAVE=false -c SAVE_NAME=myworld
gsmc launch lgsm-gmod -c maxplayers=32 -c servername="My Server"
Config files
For heavier customization, generate a config file, edit it, and pass it at launch:
# Generate a config file with defaults
gsmc config factorio --init -o factorio.env
gsmc config lgsm-rust --init -o rust.cfg
# Edit the file, then launch with it
gsmc launch factorio --config-file factorio.env
gsmc launch lgsm-rust --config-file rust.cfg
Both generate .cfg files with the game's defaults. LinuxGSM configs include commented extras with descriptions.
Config precedence
Config values are merged in this order (last wins):
- Game defaults
- Config file values (
--config-file) - Inline overrides (
-c key=value)
Required config
Some games require specific config keys to be set before they can launch (e.g. steamuser for games that need a Steam account to download). gsmc will tell you what's missing and how to provide it:
gsmc launch lgsm-dayz
# Error: Missing required config key 'steamuser'
# Provide via: --config steamuser=VALUE
📋 CLI Reference
gsmc games
List all supported games with their CLI names, instance types, and ports.
Server Lifecycle
gsmc launch GAME
Launch a game server on EC2.
| Flag | Description |
|---|---|
-n, --name TEXT |
Server name |
-t, --instance-type TEXT |
EC2 instance type |
-r, --region TEXT |
AWS region (default: us-east-1) |
-u, --upload LOCAL:REMOTE |
Upload file before launch (repeatable) |
--from-snapshot ID |
Launch from a snapshot |
-c, --config KEY=VALUE |
Config option (repeatable) |
--config-file PATH |
Config file |
--pin-ip |
Pin a static Elastic IP to this server |
gsmc list
List all servers.
gsmc info SERVER
Show detailed information for a server.
gsmc destroy SERVER
Terminate a server and clean up AWS resources.
| Flag | Description |
|---|---|
--all |
Destroy all servers |
-y, --yes |
Skip confirmation |
Pause & Resume
gsmc pause SERVER
Stop the EC2 instance to save costs. Data persists on EBS.
gsmc resume SERVER
Restart a paused or stopped server.
Container Control
gsmc stop SERVER
Stop the container (instance stays running).
Elastic IPs
gsmc pin SERVER
Pin a static Elastic IP to a server. Free while running, ~$3.65/month while paused.
gsmc unpin SERVER
Release the pinned Elastic IP.
| Flag | Description |
|---|---|
-y, --yes |
Skip confirmation |
gsmc eips
List all GSM-managed Elastic IPs.
| Flag | Description |
|---|---|
--cleanup |
Prompt to release orphaned EIPs |
Snapshots
gsmc snapshot SERVER
Create an EBS snapshot for backups or cloning.
gsmc snapshots
List all snapshots.
gsmc snapshot-delete ID
Delete a snapshot.
| Flag | Description |
|---|---|
-y, --yes |
Skip confirmation |
Server Interaction
gsmc logs SERVER
View container logs.
| Flag | Description |
|---|---|
-n, --tail LINES |
Number of lines to show |
-f, --follow |
Follow log output |
gsmc ssh SERVER
SSH into the EC2 instance.
gsmc exec SERVER COMMAND...
Run a command inside the server container.
gsmc rcon SERVER COMMAND...
Send an RCON command to the server.
gsmc upload SERVER LOCAL REMOTE
Upload a file to the server container.
gsmc download SERVER REMOTE LOCAL
Download a file from the server container.
Configuration
gsmc config GAME
Show or generate configuration for a game. Shows available config options with defaults.
| Flag | Description |
|---|---|
--init |
Generate a local config file |
-o, --output PATH |
Output path (default: <game>.cfg) |
LinuxGSM Catalog
gsmc sync
Sync LinuxGSM game configs from upstream GitHub.
| Flag | Description |
|---|---|
--list |
List all available LinuxGSM games |
--add SERVER_CODE |
Add a game to the local catalog |
--all |
Add all games and sync configs |
Other
gsmc help [COMMAND]
Show help for a command.
gsmc completion SHELL
Generate shell completion script (bash/zsh/fish).
gsmc api
Start the local REST API server.
| Flag | Description |
|---|---|
-p, --port PORT |
API port (default: 8080) |
--host HOST |
API host (default: 127.0.0.1) |
🔧 How It Works
you gsmc AWS
│ │ │
│ gsmc launch .. │ │
│─────────────────>│ create EC2 │
│ │────────────────>│
│ │ SSH + Docker │
│ │────────────────>│
│ │ open ports │
│ │────────────────>│
│ │ start server │
│ │────────────────>│
│ IP + port │ │
│<─────────────────│ │
- Provisions an EC2 instance running Amazon Linux 2023
- Installs Docker via SSH
- Pulls the game's Docker image
- Creates security group rules for the game's ports
- Launches the container with your config
State files
State is tracked locally in ~/.gsm/:
| File | Contents |
|---|---|
servers.json |
Active server records |
snapshots.json |
Snapshot records |
gsm-keypair.pem |
Auto-generated SSH key |
lgsm_catalog.json |
LinuxGSM game catalog |
lgsm_data.json |
LinuxGSM config data |
Reconciliation
gsmc list and gsmc info automatically reconcile local state with AWS before displaying results. If an instance was terminated externally (e.g. via the AWS console), gsmc detects this and removes the stale record. If an orphaned GSM-tagged instance is found running in AWS without a local record, gsmc adopts it back into state. This keeps your local view consistent with reality without requiring manual cleanup.
🐚 Shell Completion
Tab-complete server names, game names, snapshot IDs, and commands in your shell:
# bash
gsmc completion bash >> ~/.bashrc
# zsh
gsmc completion zsh >> ~/.zshrc
# fish
gsmc completion fish > ~/.config/fish/completions/gsmc.fish
🌐 REST API
Install with API support and start the server:
pipx install gsmc[api] # recommended
uv tool install gsmc[api] # if you use uv
pip install gsmc[api] # in a virtual environment
gsmc api # default: 127.0.0.1:8080
gsmc api --port 9000 --host 0.0.0.0
Endpoints
| Method | Path | Description |
|---|---|---|
GET |
/servers |
List all servers |
GET |
/servers/{id} |
Get server details |
POST |
/servers |
Launch a server |
DELETE |
/servers/{id} |
Destroy a server |
POST |
/servers/{id}/pause |
Pause a server |
POST |
/servers/{id}/stop |
Stop the container |
POST |
/servers/{id}/resume |
Resume a server |
POST |
/servers/{id}/pin |
Pin an Elastic IP |
POST |
/servers/{id}/unpin |
Release the pinned IP |
POST |
/servers/{id}/snapshot |
Create a snapshot |
GET |
/snapshots |
List all snapshots |
DELETE |
/snapshots/{id} |
Delete a snapshot |
💰 AWS Setup & Costs
Prerequisites
- AWS credentials configured via
~/.aws/credentials, environment variables, or an AWS profile - The minimum IAM policy applied to your user/role
Required permissions: EC2 instances, security groups, key pairs, EBS volumes/snapshots, Elastic IPs.
Cost estimates
Costs depend on the instance type and region (us-east-1 on-demand pricing shown). You only pay while the instance is running — gsmc pause stops the meter.
| Instance type | vCPU | RAM | ~Cost/hr | Good for |
|---|---|---|---|---|
| t3.medium | 2 | 4 GB | $0.04 | Factorio, most LinuxGSM games |
| t3.large | 2 | 8 GB | $0.08 | Larger servers |
| t3.xlarge | 4 | 16 GB | $0.17 | Rust, CS2, ARK |
| t3.2xlarge | 8 | 32 GB | $0.33 | High-population servers |
EBS storage (server data) costs ~$0.08/GB/month and persists while paused. Snapshots cost ~$0.05/GB/month. Elastic IPs are free while associated with a running instance, ~$3.65/month while the server is paused.
Disclaimer
gsmc is a convenience tool, not infrastructure-as-code. It manages AWS resources (EC2 instances, EBS volumes, security groups, Elastic IPs, snapshots) on your behalf. While gsmc reconciles state automatically and does its best to track everything, you should periodically check your AWS console to ensure no orphaned resources are left behind. gsmc provides no guarantees — you are responsible for your AWS bill.
🛠️ Development
git clone <repo>
cd game_server_maker
uv sync --all-extras
uv run pytest tests/ -v
Stack
- Click — CLI framework
- boto3 — AWS SDK
- Paramiko — SSH
- Rich — Terminal formatting
- rcon — RCON protocol
- FastAPI — REST API (optional)
🤝 Contributing
See CONTRIBUTING.md.
📄 License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gsmc-0.2.0.tar.gz.
File metadata
- Download URL: gsmc-0.2.0.tar.gz
- Upload date:
- Size: 124.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3cb5cb93d4e1fc83b878f8eb1bf522f096cd2d371245e14602880f52bf8db9d
|
|
| MD5 |
783123c2b82ace3a1265888f6bd46d36
|
|
| BLAKE2b-256 |
db15a13709a66c8809820c8a5d74fa02cd48c01c282376cf61812e2456f8277d
|
Provenance
The following attestation bundles were made for gsmc-0.2.0.tar.gz:
Publisher:
publish.yml on sabidib/gsmc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsmc-0.2.0.tar.gz -
Subject digest:
d3cb5cb93d4e1fc83b878f8eb1bf522f096cd2d371245e14602880f52bf8db9d - Sigstore transparency entry: 949278605
- Sigstore integration time:
-
Permalink:
sabidib/gsmc@e824060a50a4117f5f3e1faff4efe652495fc6f3 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/sabidib
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e824060a50a4117f5f3e1faff4efe652495fc6f3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gsmc-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gsmc-0.2.0-py3-none-any.whl
- Upload date:
- Size: 50.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
650096a1fa31871611ee7f900735f8cb90c2504f23371b581b3ee0abda798f49
|
|
| MD5 |
b134260133aaf204cdc3ee3da95c386d
|
|
| BLAKE2b-256 |
26c7ee06e8b4d528e64bd25c8e75cec3fbafbfc8f2f6a754920645e8e2bb09ee
|
Provenance
The following attestation bundles were made for gsmc-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on sabidib/gsmc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsmc-0.2.0-py3-none-any.whl -
Subject digest:
650096a1fa31871611ee7f900735f8cb90c2504f23371b581b3ee0abda798f49 - Sigstore transparency entry: 949278657
- Sigstore integration time:
-
Permalink:
sabidib/gsmc@e824060a50a4117f5f3e1faff4efe652495fc6f3 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/sabidib
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e824060a50a4117f5f3e1faff4efe652495fc6f3 -
Trigger Event:
release
-
Statement type: