Manual Setup Alert

This guide shows manual installation. With GameCP, you get auto-restarts, built-in mod management, resource monitoring, and 1-click updates β€” plus unlimited servers on a single node vs. traditional hosts that charge per slot.

Auto-restarts
Mod manager
Live monitoring
1-click updates
Skip the Manual Work β€” Deploy in 5 Minutes
Part 7 of 12: Game ConfigurationNext Part β†’
Game Configuration: Scripts & Lifecycle
Game ConfigurationAdvanced

Game Configuration: Scripts & Lifecycle

GameCP Team
2/20/2026
game-config, scripts, lifecycle, install, startup, automation

This is Part 7 of the Game Configuration series. Scripts let you run custom commands at specific points during a game server's lifecycle β€” before or after install, start, and stop events.


What Are Lifecycle Scripts?

Lifecycle scripts are custom shell or PowerShell scripts that execute automatically during server operations. They're used for tasks like:

  • Downloading game files during installation
  • Setting file permissions before startup
  • Backing up world data before shutdown
  • Running update checks after installation
  • Cleaning temporary files after stopping

Script Properties

Each script has several key settings:

Timing

When the script runs relative to the event:

  • Before β€” runs before the event (e.g., before installation starts)
  • After β€” runs after the event completes (e.g., after installation finishes)

Event

Which lifecycle event triggers the script:

EventWhen It Fires
InstallWhen the game server is being installed or reinstalled
StartWhen the game server is starting up
StopWhen the game server is shutting down

Common Combinations

Timing + EventUse Case
Before InstallDownload game files via SteamCMD or curl
After InstallSet permissions, copy default configs
Before StartCheck for updates, validate files
After StartSend notification, register with master server
Before StopSave world, create backup
After StopClean up temp files, compress logs

Platform

Which operating system the script targets:

  • Both β€” runs on Windows and Linux nodes (provide scripts for each)
  • Windows Only β€” only runs on Windows nodes
  • Linux Only β€” only runs on Linux nodes

When set to "Both", you write separate scripts for each platform using the platform tabs in the script editor.

Execution Context

Where the script runs:

  • Docker Container β€” runs inside a Docker container (isolated, safe, can use a different image)
  • Node Server (Host) β€” runs directly on the host machine (has full access)

Most scripts should use Docker Container for safety. Use Node Server only when the script needs host-level access.


Docker Container Settings

When using Docker Container context, you can configure:

  • Container Image β€” override the default image (e.g., use a Debian installer image for downloading files)
  • Container Entrypoint β€” the shell to use (bash, sh, ash)
  • Container Mount Path β€” where the server files are mounted inside the container

This is particularly useful for installation scripts that need tools not present in the game's runtime image.


Advanced Settings

  • Working Directory β€” the directory where the script executes (default: /)
  • Timeout β€” maximum time in seconds before the script is killed (0 = unlimited)
  • Retry on Failure β€” automatically retry the script if it fails
  • Max Retries β€” how many times to retry (default: 3)

Script Content

The script editor provides a full code editor with syntax highlighting. Write your script in either Bash (Linux) or PowerShell (Windows) using the platform tabs.

Environment variables from the game config are available inside scripts. You can reference them directly:

#!/bin/bash
echo "Installing to ${SERVER_FOLDER}"
echo "Server name: ${SERVER_NAME}"

Ordering

Scripts can be reordered by dragging them in the list. Scripts execute in the order shown β€” top to bottom β€” for each timing+event combination.


Tips

  • Use the "Before Install" event for SteamCMD downloads β€” this is where most game templates fetch their files
  • Set a reasonable timeout for installation scripts β€” some game downloads take several minutes
  • The Docker Container context with a custom image (like ghcr.io/ptero-eggs/installers:debian) gives you access to tools like curl, unzip, and jq that may not be in the game's runtime image
  • Scripts show their timing, event, and platform as badges in the list for quick identification
  • You can enable/disable individual scripts with the toggle β€” useful for temporarily skipping a script without deleting it