Pterodactyl Game Server Management Platform

repository·master·Indexed 41 days ago

https://github.com/pterodactyl/documentation

A game server management platform using Docker to provide isolated, secure, and resource-limited environments. Documentation covers the Pterodactyl Panel, creating custom Eggs and services, configuring process management, and installing and configuring the Daemon (Wings) and Nodes.

Tokens
36.5K
Snippets
151
Records
203
Agent score
53%

What's inside Pterodactyl

  1. Overview of Pterodactyl Architecture

    master
    Pterodactyl is an open-source game server management panel built using PHP, React, and Go. It uses Docker containers to isolate game server instances, ensuring that each server runs in a secure, independent environment without requiring additional dependencies to be installed directly on the host machine. This architecture allows for hosting a wide variety of games across different physical machines efficiently.
  2. Overview of Pterodactyl Panel features

    master

    Pterodactyl is a game server management platform designed with a focus on security, modern tooling, and containerization. Key features include:

    • Security First: Implements bcrypt hashing, AES-256-CBC encryption, and out-of-the-box HTTPS support.
    • Modern Tooling: Built on a modern stack designed for ease of modification and development.
    • Docker-centric Architecture: All game servers run in isolated Docker containers, which provides strict resource limits, reduces attack vectors, and allows for game-specific environments.
  3. System Requirements and Supported Operating Systems

    master

    Pterodactyl Panel requires root access and a Linux environment. It is not compatible with most OpenVZ systems due to Docker incompatibilities.

    Supported Operating Systems

    • Ubuntu: 22.04 (requires additional PHP repositories), 24.04 (MariaDB can be installed without repo setup scripts).
    • RHEL / Rocky Linux / AlmaLinux: Versions 8 and 9 (requires extra repositories).
    • Debian: Versions 11, 12, and 13.

    Core Dependencies

    • PHP: 8.2 or 8.3 (recommended) with extensions: cli, openssl, gd, mysql, PDO, mbstring, tokenizer, bcmath, xml or dom, curl, zip, and fpm (if using NGINX).
    • Database: MySQL 5.7.22+ (MySQL 8 recommended) or MariaDB 10.2+.
    • Redis: redis-server.
    • Webserver: Apache, NGINX, Caddy, etc.
    • Other Tools: curl, tar, unzip, git, and composer v2.
  4. How Pterodactyl telemetry works

    master

    The telemetry system generates a unique UUIDv4 identifier for the Panel installation, which is stored in the database to maintain identity across load-balanced instances.

    Every 24 hours, the TelemetryCollectionService collects aggregate data (such as Panel version, PHP version, database driver, and resource counts like allocations, backups, and servers) and sends it to a remote server. The data is collected immediately before transmission and is not stored locally for long periods. The collected data is currently processed and stored using Cloudflare Workers and Cloudflare D1.

  5. Responsible Disclosure Policy

    master

    Pterodactyl is open-source and encourages independent security audits. If you discover a security vulnerability, please report it directly to support@pterodactyl.io.

    Important: Do not report security concerns on the public-facing bug tracker. Please practice responsible disclosure when communicating findings.

  6. How the entrypoint script handles startup variables

    master

    The Pterodactyl Daemon passes a STARTUP environment variable to the container. This variable often contains placeholders in the format {{VARIABLE_NAME}}, which correspond to other environment variables defined in the Egg configuration.

    To execute the command correctly, the entrypoint.sh script must parse the STARTUP string and replace these placeholders with their actual values.

    Example Workflow:

    1. Input STARTUP: java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}
    2. Environment Variables: SERVER_MEMORY=1024, SERVER_JARFILE=server.jar
    3. Parsing Logic: The script uses sed to convert {{VAR}} to {VAR} so that eval echo can expand them.
    4. Resulting Command: java -Xms128M -Xmx1024M -jar server.jar

    Parsing Command:

    MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
  7. Configure Proxy Server Networking

    master

    Because Pterodactyl runs servers in isolated Docker containers, localhost or 127.0.0.1 inside a container refers to the container itself, not the host node.

    To allow a proxy server (like BungeeCord or Waterfall) to communicate with game servers on the same node, you must use the node's internal IP address within the Pterodactyl network. By default, this address is 172.18.0.1. Use this IP in your proxy server's configuration files to point to the backend game servers.

  8. Understand Pterodactyl core terminology

    master

    To effectively manage a Pterodactyl deployment, you must understand the relationship between the following components:

    • Panel: The central web interface and management system used to add nodes and create servers.
    • Node: A physical or virtual machine that runs the Wings service.
    • Wings: The Go-based service running on a Node that interfaces with Docker and the Panel to manage servers.
    • Server: A running instance of a game or application created by the Panel and hosted on a Node.
    • Docker: The underlying platform used to isolate servers into containers.
    • Docker Image: A package containing all dependencies required to run a specific application (e.g., a Java runtime).
    • Container: The isolated environment created by Docker where each Server runs to enforce hardware limits (CPU/RAM) and prevent interference.
    • Nest: A grouping mechanism used for specific games or services (e.g., Minecraft) that contains multiple Eggs.
    • Egg: A configuration template for a specific type of game or service (e.g., a Spigot egg within a Minecraft nest).
    • Yolks: A curated collection of core Docker images designed for use with the Pterodactyl Egg system.
  9. Logging Changes in Daemon 0.6.X

    master

    In version 0.6.X, the Daemon switched from custom logging to using Docker logging functionality.

    Benefits:

    • Better captures events that occur before a container is fully attached.
    • Centralizes logging logic.
    • Allows Docker to manage logs directly.
    • Provides full container output leading up to a crash, rather than generic "Server has crashed" messages.
  10. Deploy Panel and Wings on a single machine

    master
    While a standard architecture separates the Panel and the Node, it is possible to install Wings on the same machine running the Panel. In this configuration, the machine acts as both the management interface (Panel) and the server host (Node) simultaneously.
  11. Install dependencies for building Panel assets

    master

    To build the Panel frontend, you must install NodeJS and Yarn. The build tools require NodeJS (version 22.x is recommended based on the setup scripts) and Yarn as the package manager.

    Warning: Do not run these build steps on your production nodes.

    # Ubuntu/Debian
    curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash - 
    sudo apt install -y nodejs
    
    # CentOS
    curl -sL https://rpm.nodesource.com/setup_22.x | sudo -E bash -
    sudo yum install -y nodejs yarn # CentOS 7
    sudo dnf install -y nodejs yarn # CentOS 8, Rocky Linux 8, AlmaLinux 8