# Pterodactyl Game Server Panel

> Open source game server management panel with Wings daemon, MariaDB, Redis, and Nginx reverse proxy.

- Category: Home Lab & Self-Hosting
- Difficulty: advanced
- Components: pterodactyl-panel, wings, mariadb, redis, nginx
- Tags: gaming, game-server, pterodactyl, minecraft, panel
- Source: https://docker.recipes/homelab/pterodactyl-panel

## Overview

Pterodactyl Panel is a modern, open-source game server management panel that revolutionizes how administrators deploy and manage game servers. Originally created to address the limitations of traditional game hosting panels, Pterodactyl provides a Docker-native architecture with its Wings daemon handling server isolation and resource management. The panel offers an intuitive web interface for managing multiple game servers across different nodes, supporting popular games like Minecraft, ARK: Survival Evolved, Rust, Garry's Mod, and Counter-Strike servers with automated backups, file management, and real-time console access.

This comprehensive stack combines Pterodactyl Panel with MariaDB for storing server configurations, user accounts, and game data, while Redis handles session management and caching for improved panel performance. The Wings daemon (deployed separately on game server nodes) communicates with the panel through secure APIs, managing Docker containers that isolate individual game servers. NGINX serves as the reverse proxy, providing SSL termination, load balancing for multiple panel instances, and efficient static file delivery for the panel's modern React-based frontend.

This configuration is ideal for game hosting companies, community server networks, and advanced homelab enthusiasts who need enterprise-grade game server management. The combination of Pterodactyl's resource isolation through Docker, MariaDB's reliable data persistence, Redis's high-performance caching, and NGINX's robust proxy capabilities creates a scalable platform that can manage hundreds of game servers across multiple physical nodes while providing users with a streamlined server management experience.

## Features

- Multi-node game server management with Wings daemon communication
- Docker-based server isolation with automatic resource limiting
- Redis-powered session management and panel performance caching
- MariaDB storage for user accounts, server configurations, and audit logs
- Real-time server console access through WebSocket connections
- Automated game server backups with configurable retention policies
- Pterodactyl's egg system for easy game server template deployment
- NGINX reverse proxy with SSL termination and static asset optimization

## Use cases

- Game hosting companies managing customer Minecraft, ARK, and Rust servers
- Community gaming networks with multiple servers across different games
- Educational institutions hosting game servers for computer science courses
- Homelab enthusiasts running family/friend gaming servers with proper management
- Development teams testing multiplayer games across isolated server instances
- Gaming communities migrating from shared hosting to dedicated infrastructure
- Server administrators consolidating multiple game panel solutions

## Prerequisites

- Minimum 4GB RAM (2GB for panel stack, 2GB+ per game server)
- Docker Engine 20.10+ with compose plugin support
- Ports 80/443 available for NGINX reverse proxy
- Valid SSL certificates or domain for HTTPS panel access
- Understanding of game server administration and Docker concepts
- Separate Wings daemon installation on game server nodes

## docker-compose.yml

```yaml
services:
  panel:
    image: ghcr.io/pterodactyl/panel:latest
    environment:
      APP_URL: ${APP_URL}
      APP_TIMEZONE: ${APP_TIMEZONE}
      APP_SERVICE_AUTHOR: ${APP_SERVICE_AUTHOR}
      DB_HOST: database
      DB_PORT: 3306
      DB_DATABASE: ${MYSQL_DATABASE}
      DB_USERNAME: ${MYSQL_USER}
      DB_PASSWORD: ${MYSQL_PASSWORD}
      REDIS_HOST: cache
      CACHE_DRIVER: redis
      SESSION_DRIVER: redis
      QUEUE_CONNECTION: redis
    volumes:
      - panel_var:/app/var
      - panel_nginx:/etc/nginx/http.d
      - panel_logs:/app/storage/logs
    depends_on:
      database:
        condition: service_healthy
      cache:
        condition: service_healthy
    networks:
      - pterodactyl
    restart: unless-stopped

  database:
    image: mariadb:10.11
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
    volumes:
      - database:/var/lib/mysql
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - pterodactyl
    restart: unless-stopped

  cache:
    image: redis:alpine
    volumes:
      - cache:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - pterodactyl
    restart: unless-stopped

  nginx:
    image: nginx:alpine
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - ./certs:/etc/nginx/certs:ro
    depends_on:
      - panel
    networks:
      - pterodactyl
    restart: unless-stopped

volumes:
  panel_var:
  panel_nginx:
  panel_logs:
  database:
  cache:

networks:
  pterodactyl:
    driver: bridge
```

## .env

```bash
# App Configuration
APP_URL=https://panel.example.com
APP_TIMEZONE=UTC
APP_SERVICE_AUTHOR=admin@example.com

# Database
MYSQL_ROOT_PASSWORD=secure_root_password
MYSQL_DATABASE=pterodactyl
MYSQL_USER=pterodactyl
MYSQL_PASSWORD=secure_db_password
```

## Usage notes

- Panel available at https://panel.example.com
- Create admin user: docker compose exec panel php artisan p:user:make
- Wings daemon runs on game servers separately
- Supports Minecraft, ARK, Rust, and more

## Troubleshooting

- Panel shows 'Redis connection failed': Verify cache service is healthy and Redis port 6379 is accessible within Docker network
- Database connection errors on panel startup: Check MariaDB healthcheck status and ensure MYSQL_* environment variables match between services
- Wings daemon cannot connect to panel: Ensure APP_URL is accessible from Wings nodes and API tokens are correctly configured
- NGINX 502 Bad Gateway errors: Confirm panel service is running and listening on correct port, check Docker network connectivity
- Game server deployment fails: Verify Wings daemon is running on target node and Docker socket is accessible
- Panel performance issues with multiple users: Increase Redis memory allocation and enable MariaDB query cache optimization

