Part 8 of 12: Game ConfigurationNext Part →
Game Configuration: Configuration Files
Game ConfigurationIntermediate

Game Configuration: Configuration Files

GameCP Team
2/21/2026
game-config, config-files, templates, settings, properties

This is Part 8 of the Game Configuration series. Configuration files let you define editable game config templates that users can customize directly from GameCP — without SSHing into the server or using the file manager.


What Are Configuration Files?

Many games use text-based config files (like server.properties, server.cfg, or config.json) to control server settings. GameCP's Configuration Files system lets you:

  1. Define the structure of these files in the game config
  2. Expose specific settings as editable fields in the server settings UI
  3. Automatically write the file to disk with the user's values on startup

This means users can change game settings through a clean, labeled form instead of editing raw config files.


Adding a Configuration File

Click Add Config File to open the editor. Each config file requires:

Basic Properties

PropertyDescription
NameA human-readable name (e.g., "Server Properties")
DescriptionWhat this config file controls
FolderThe directory path inside the server (e.g., /)
FilenameThe actual file name (e.g., server.properties)
File TypeThe format: properties, yaml, json, ini, xml, toml, or text

Fields

Each config file contains fields — the individual settings that users can edit. Fields have:

PropertyDescription
KeyThe setting key in the file (e.g., max-players)
LabelThe human-readable name shown to users (e.g., "Max Players")
DescriptionHelp text explaining the setting
Default ValueThe initial value
TypeInput type: text, number, select, toggle
RequiredWhether the field must have a value

File Types

The file type determines how GameCP writes the config file:

TypeFormatExample
propertieskey=value per lineMinecraft server.properties
yamlYAML structureVarious modern games
jsonJSON objectNode.js game servers
ini[Section] + key=valueSource engine games
xmlXML elementsSome legacy games
tomlTOML formatRust, newer configs
textRaw text templateCustom formats

Variable Substitution

Config file field values support variable substitution using {{VARIABLE_NAME}} syntax. This lets config values reference environment variables:

  • {{SERVER_NAME}} — resolves to the server's name variable
  • {{MAX_PLAYERS}} — resolves to the max players variable
  • {{PORT}} — resolves to the assigned port

This creates a connection between the environment variables users edit and the actual config file content.


Ordering and Toggling

  • Drag to reorder config files in the list
  • Toggle individual files on/off — disabled files won't be written to disk
  • Config files show their file path, file type, and field count in the list view

How It Works at Runtime

When a game server starts:

  1. GameCP reads the config file definition from the game config
  2. Substitutes all variable references with actual values
  3. Writes the file to the correct path inside the server's data directory
  4. The game reads the file on startup with the user's custom values

If a user changes a setting, the file is regenerated on the next restart.


Tips

  • Start with the most important settings and add more fields over time — you don't need to expose every possible setting
  • Use select type for fields with fixed options (like game mode or difficulty) to prevent invalid values
  • The file path is relative to the server's data directory — use / or leave the folder empty for the root
  • Config files are a great way to make a game template user-friendly without requiring any command-line knowledge
  • If the game has multiple config files, create a separate config file entry for each one