Skip to content

Default Variables

Aleksandar Ovcharov edited this page Dec 24, 2023 · 1 revision

Default Variables

This section allows you to set default server variables. These variables are crucial for configuring server settings, such as player limits, environmental parameters, or other custom settings.

Important: The variables used here must correspond to those available in your Pterodactyl Egg settings. This alignment ensures that the variables defined in the JSON configuration are recognized and properly applied by the Pterodactyl server management system.

JSON Format: Default variables should be defined using JSON format for structured and clear configuration.

Example: To set a maximum number of players to 30, use: {"MAX_PLAYERS": 30}

It is essential to ensure that any variable such as MAX_PLAYERS, QUERY_PORT, etc., used in the JSON configuration, is also defined in the Egg's variable settings in the Pterodactyl panel. This ensures consistency and proper functionality.

These settings provide a standardized baseline for server operations, making it easier to manage and deploy servers with consistent configurations.

You can use https://jsonlint.com to validate your default variables json.

Custom Variables From PteroSync

These are special variables provided by PteroSync, designed to enhance the functionality and configurability of your server setup within the Pterodactyl environment.

  • SERVER_PORT_OFFSET: Returns the SERVER port offset, if it exists. This variable is particularly useful for dynamically setting other port-related variables within your configuration.
    For example, you can use SERVER_PORT_OFFSET to automatically determine the QUERY_PORT or any other port setting in your default variables, ensuring consistent and context-aware configuration.
    Usage: In your JSON configuration for default variables, you can reference this variable as needed. For example, {"QUERY_PORT": "SERVER_PORT_OFFSET"} would dynamically set the QUERY_PORT based on the SERVER_PORT_OFFSET value.

Using these custom variables allows for more sophisticated and tailored server configurations, taking advantage of the advanced features offered by PteroSync within the Pterodactyl platform.

Clone this wiki locally