You can help the project support more game dedicated servers.
-
Find a docker image for your game, or create one based on something like steamcmd/steamcmd or cm2network/steamcmd
-
(Suggestion) Create a
docker-compose.yml
file for your game server and run it locally to make sure the game server image works as intended -
(Suggestion) Please read Custom game and then test the game using
custom
game server module, where you will run the game server in AWS.- Fill the variables, apply the Terraform changes and try to connect and the server via DDNS
- You don't need to set up Discord for testing, you can start/stop the server via AWS console
Tip
You may want to set data_volume_final_snapshot
to false
to avoid creating final snapshots during data volume destroy, which may be done several times during testing.
- The server is able to connected to in-game and played normally
- If the server is started more than once, it will have a different IPv4. Sometimes DNS cache will make the DDNS domain point to the outdated IP, so you may want to connect (SSH and in-game) by referencing the IP directly.
- Connect to the server via SSH and:
- Check
docker compose logs
in/srv/<game id>
to see if the server is properly started - If needed, temporarly, disable auto shutdown to debug and inspect the logs and check for any errors. See Useful info and commands
- Use
htop
anddocker stats
while the container is running to check if the CPU and RAM resources are ok - Use
fastfetch
anddf -h
if check storage usage
- Check
- The server is properly shut down within 10-12min after the last player leaves
-
Choose an alphanumeric, lowercase id for your game
-
Add the ID to the
game
variable validation. -
In
server/main.tf
modify thegame_defaults_map
local by adding a object entry, where the key is the game id and the value is an object with the following properties:game_name
: Display name used in AWS resources Name taginstance_type
: Instance type which supports and is powerful enough to run the game server. See Server instance typearch
: CPU architecture of the chosen instance typedata_volume_size
: Storage required for game data and files, and also for auto updates if applicable (so double the server data in GB + 1GB for save files, for example).- Note that the Docker image is stored in the root volume so its size doesn't count
- Remember that a 10GB data volume, without free tier offers, would on its own already cost 0.8 USD per month in us-east-2 (Ohio) region.
compose_main_service_name
: For ease of use when running commands during SSH session, can be the game idmain_port
: The port used for player connections, will be checked periodically to shutdown the server if no connections are established after a whilesg_ingress_rules
(Optional): If the game requires more than one port to be open, you may define them here to have them automatically open in the VPC layerwatch_connections
: If the game server docker image has an auto shutdown feature, you may disable the scripts which watch connections via main port monitoring
Make sure you use coalesce()
where necessary to avoid errors with use of unset variables.
These will be the default values when selecting this game in the module variables, and should be optimized for cost but also able to run the server for a few players.
-
In the same file, inside the
main_service_map
local, create a YAML-like object which represents the docker compose service which will be placed in adocker-compose.yml
file inside the instance- You may map the volumes using the
data_subfolder_path
ordata_mount_path
locals - Use
restart=no
so auto shutdown works properly andstop_grace_period=2m
to allow graceful server shutdown due to spot instance interruption or Discord slash command
- You may map the volumes using the
-
Update
README.md
- "Supported games": Add the game name and link to docker image
- "Setup": add game id to possible values options
- "Cost breakdown"
- Use the Vantage website or the price history in AWS console Spot request page to calculate the values of the "TL;DR" list and "Notable expenses" table
- If there's any importants notes for setting up the game server, such as setting up server password via Terraform or SSH, you may add them as a new section in Game specific notes
-
Create pull request