# Game Server Stack

> Pterodactyl game server panel with Wings daemon for hosting multiple game servers

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

## Overview

Pterodactyl Panel is an open-source game server management platform built on Laravel and React, designed to provide a modern web interface for managing multiple game servers from a single dashboard. Originally created in 2015, Pterodactyl has become one of the most popular self-hosted game server management solutions, offering features like resource monitoring, file management, user permissions, and automated backups. The platform consists of two main components: the Panel (web interface) and Wings (daemon that actually manages the game servers). This stack combines Pterodactyl Panel with Wings daemon, MariaDB for data persistence, and Redis for session management and caching. MariaDB serves as the primary database storing server configurations, user accounts, and operational data, while Redis handles session storage and caches frequently accessed data to improve panel responsiveness. Wings daemon communicates with the panel via API and manages Docker containers for individual game servers, providing isolation and resource control. The combination creates a comprehensive game hosting platform that can manage everything from small Minecraft servers to large-scale multiplayer game deployments. This stack is ideal for gaming communities, hosting providers, educational institutions, and developers who need reliable game server management with modern tooling. The architecture supports horizontal scaling, allowing multiple Wings nodes to be managed from a single panel instance, making it suitable for everything from home labs to commercial hosting operations.

## Features

- Web-based game server management with real-time console access and file manager
- Multi-node support allowing Wings daemons on different servers managed from one panel
- Docker-based game server isolation with configurable resource limits and networking
- Built-in support for 15+ games including Minecraft, CS:GO, ARK, Rust, and Garry's Mod
- Redis-powered session management and caching for improved panel performance
- MariaDB with Aria storage engine for enhanced crash recovery and performance
- RESTful API for automated server provisioning and management integrations
- Advanced user permission system with subuser access and role-based controls

## Use cases

- Gaming community hosting multiple Minecraft, CS:GO, or Rust servers with centralized management
- Educational institutions providing game development servers for computer science courses
- Commercial game hosting providers offering managed server services to customers
- Esports organizations managing practice and tournament servers across multiple games
- Home lab enthusiasts running personal game servers for friends and family
- Discord communities providing dedicated servers for various multiplayer games
- Game development studios hosting playtesting and development servers

## Prerequisites

- Minimum 4GB RAM (2GB for panel/database, 2GB+ for game servers)
- Docker Engine with privileged container support for Wings daemon
- Port 80/443 available for panel web interface and 8080/2022 for Wings API
- Understanding of game server configuration and Docker container concepts
- SSL certificate for production deployments (Let's Encrypt recommended)
- Basic knowledge of MySQL/MariaDB for database maintenance and backups

## docker-compose.yml

```yaml
services:
  panel:
    image: ghcr.io/pterodactyl/panel:latest
    container_name: pterodactyl-panel
    restart: unless-stopped
    ports:
      - "${PANEL_PORT:-80}:80"
      - "${PANEL_SSL:-443}:443"
    environment:
      - DB_HOST=panel-db
      - DB_PORT=3306
      - DB_DATABASE=panel
      - DB_USERNAME=pterodactyl
      - DB_PASSWORD=${DB_PASSWORD}
      - APP_URL=http://localhost:${PANEL_PORT:-80}
      - APP_TIMEZONE=${TZ:-UTC}
      - REDIS_HOST=panel-redis
      - 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:
      - panel-db
      - panel-redis

  panel-db:
    image: mariadb:10.11
    container_name: panel-db
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
      - MYSQL_DATABASE=panel
      - MYSQL_USER=pterodactyl
      - MYSQL_PASSWORD=${DB_PASSWORD}
    volumes:
      - panel_db_data:/var/lib/mysql

  panel-redis:
    image: redis:7-alpine
    container_name: panel-redis
    restart: unless-stopped

  wings:
    image: ghcr.io/pterodactyl/wings:latest
    container_name: pterodactyl-wings
    restart: unless-stopped
    ports:
      - "8080:8080"
      - "2022:2022"
    environment:
      - TZ=${TZ:-UTC}
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/containers:/var/lib/docker/containers
      - ./wings/config:/etc/pterodactyl
      - /var/lib/pterodactyl:/var/lib/pterodactyl
      - /tmp/pterodactyl:/tmp/pterodactyl

volumes:
  panel_var:
  panel_nginx:
  panel_logs:
  panel_db_data:
```

## .env

```bash
# Pterodactyl Game Server Stack
PANEL_PORT=80
PANEL_SSL=443
TZ=UTC

# Database
DB_PASSWORD=pterodactyl_password
DB_ROOT_PASSWORD=root_password
```

## Usage notes

- Panel at http://localhost (create admin user)
- Wings daemon connects to panel for game servers
- Create admin: docker exec pterodactyl-panel php artisan p:user:make
- Configure Wings node in Panel settings
- Supports Minecraft, ARK, Rust, CS:GO, and more
- Each game server runs in isolated container

## Troubleshooting

- Wings daemon shows 'connection refused' in panel: Verify Wings configuration file contains correct panel URL and API tokens match between panel and Wings config
- Game servers fail to start with 'Docker socket permission denied': Add pterodactyl user to docker group or run Wings container with proper Docker socket permissions
- Panel shows 500 error during installation: Check MariaDB connection and ensure database credentials in panel environment variables match database container settings
- Redis connection timeout in panel logs: Verify panel-redis container is running and panel Redis host environment variable points to correct container name
- Wings node appears offline in panel: Check Wings daemon logs for API authentication errors and verify panel URL is accessible from Wings container
- Game servers consume excessive memory: Configure Wings daemon memory limits in node configuration and ensure Docker container resource constraints are properly set

