Skip to content

Deploying Pterodactyl

Introduction

Pterodactyl is an open-source game server management panel built with PHP, React, and Go. It provides a beautiful, feature-rich interface for managing game servers with a focus on security and ease of use. Pterodactyl supports a wide variety of games including Minecraft, Rust, ARK, Terraria, and many more through its egg system.

The panel separates into two components: the Panel (web interface) and Wings (the server control daemon). This architecture allows for distributed deployment where game servers can run on different machines while being managed from a central panel.

Key highlights of Pterodactyl:

  • Multi-Game Support: Manage servers for dozens of different games
  • Docker Isolation: Each game server runs in its own Docker container
  • User Management: Create users with granular permissions
  • Server Subusers: Allow server owners to add collaborators
  • File Manager: Built-in web-based file browser and editor
  • Console Access: Real-time console with command execution
  • Backup System: Automated and manual backup support
  • Resource Limits: CPU, memory, and disk allocation per server
  • API Access: Full REST API for automation
  • Open Source: Licensed under MIT

This guide walks through deploying the Pterodactyl Panel on Klutch.sh using Docker.

Why Deploy Pterodactyl on Klutch.sh

Deploying Pterodactyl Panel on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Pterodactyl without complex configuration.

Persistent Storage: Attach persistent volumes for panel data and configurations.

HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure access.

GitHub Integration: Connect your repository directly from GitHub for automatic deployments.

Custom Domains: Assign a custom domain for your game server management portal.

Always-On Availability: Your panel remains accessible 24/7 for server management.

Prerequisites

Before deploying Pterodactyl on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your Pterodactyl configuration
  • A MySQL/MariaDB database
  • Redis instance for caching and queues
  • Basic familiarity with Docker and containerization concepts
  • (Optional) A custom domain for your Pterodactyl Panel
  • (Optional) Separate servers for Wings daemon

Understanding Pterodactyl Architecture

Pterodactyl consists of two main components:

Panel: The web interface built with Laravel (PHP) and React. Handles user authentication, server management, and API requests.

Wings: The Go-based daemon that runs on each node hosting game servers. Manages Docker containers, file systems, and console connections.

Note: This guide covers deploying the Panel. Wings must be deployed on servers where you want to run game servers.

Preparing Your Repository

Create a GitHub repository containing your Dockerfile for Pterodactyl Panel deployment.

Repository Structure

pterodactyl-deploy/
├── Dockerfile
├── .env.example
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM ghcr.io/pterodactyl/panel:latest
# Set environment variables
ENV APP_ENV=production
ENV APP_DEBUG=false
ENV APP_TIMEZONE=UTC
# The panel image includes all necessary setup
EXPOSE 80
CMD ["/entrypoint.sh"]

Creating .env.example

Create a .env.example file for reference:

Terminal window
# Application
APP_ENV=production
APP_DEBUG=false
APP_KEY=
APP_TIMEZONE=UTC
APP_URL=https://your-app-name.klutch.sh
# Database
DB_CONNECTION=mysql
DB_HOST=your-db-host
DB_PORT=3306
DB_DATABASE=pterodactyl
DB_USERNAME=pterodactyl
DB_PASSWORD=your-db-password
# Redis
REDIS_HOST=your-redis-host
REDIS_PORT=6379
REDIS_PASSWORD=null
# Cache and Session
CACHE_DRIVER=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis
# Mail
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@example.com
MAIL_FROM_NAME="Pterodactyl Panel"
# Trusted Proxies
TRUSTED_PROXIES=*

Creating the .dockerignore File

Create a .dockerignore file:

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env

Deploying Pterodactyl on Klutch.sh

    Generate Application Key

    Generate a secure application key:

    Terminal window
    php -r "echo 'base64:' . base64_encode(random_bytes(32)) . PHP_EOL;"

    Save this key for environment variables configuration.

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub:

    Terminal window
    git init
    git add Dockerfile .env.example .dockerignore
    git commit -m "Initial Pterodactyl Panel deployment configuration"
    git remote add origin https://github.com/yourusername/pterodactyl-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “pterodactyl” or “game-panel”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Pterodactyl Dockerfile.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 80

    Set Environment Variables

    Add the following environment variables:

    VariableValue
    APP_ENVproduction
    APP_DEBUGfalse
    APP_KEYYour generated application key
    APP_URLhttps://your-app-name.klutch.sh
    APP_TIMEZONEUTC
    DB_CONNECTIONmysql
    DB_HOSTYour database host
    DB_DATABASEpterodactyl
    DB_USERNAMEYour database user
    DB_PASSWORDYour database password
    REDIS_HOSTYour Redis host
    CACHE_DRIVERredis
    SESSION_DRIVERredis
    QUEUE_CONNECTIONredis
    TRUSTED_PROXIES*

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /app/var5 GBApplication cache and logs
    /app/storage10 GBFile storage

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will:

    • Detect your Dockerfile automatically
    • Build the container image
    • Attach the persistent volumes
    • Start the Pterodactyl Panel container
    • Provision an HTTPS certificate

    Run Database Migrations

    After deployment, run database setup commands:

    Terminal window
    php artisan migrate --seed --force

    Create Admin User

    Create your administrator account:

    Terminal window
    php artisan p:user:make

    Access Pterodactyl

    Once deployment completes, access your Pterodactyl Panel at https://your-app-name.klutch.sh. Log in with your admin credentials.

Setting Up Wings (Node)

To run game servers, you need to deploy Wings on a separate server:

Wings Requirements

  • Linux server (Ubuntu 20.04+ recommended)
  • Docker installed
  • Kernel virtualization support
  • At least 2GB RAM for the daemon

Installing Wings

  1. In the Panel, go to Admin > Nodes
  2. Create a new node with server details
  3. Copy the auto-deployment script
  4. Run on your node server
Terminal window
curl -L -o /usr/local/bin/wings "https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_amd64"
chmod u+x /usr/local/bin/wings

Configuring Wings

  1. Copy configuration from Panel (Admin > Nodes > Configuration)
  2. Save to /etc/pterodactyl/config.yml
  3. Start Wings as a service

Creating Game Servers

Adding an Egg

  1. Go to Admin > Nests
  2. Import or create eggs for your games
  3. Configure startup commands and Docker images

Creating a Server

  1. Go to Admin > Servers > Create New
  2. Select owner and node
  3. Choose nest and egg
  4. Configure resource limits
  5. Set startup parameters
  6. Create server

Resource Allocation

ResourceRecommendation
CPU100-200% per core
MemoryBased on game requirements
DiskBased on game size
Swap50% of memory

User Management

Creating Users

  1. Go to Admin > Users
  2. Click “Create New”
  3. Set email and password
  4. Assign admin permissions if needed

Server Subusers

Allow server owners to add collaborators:

  1. Go to server management
  2. Click “Users” tab
  3. Add subuser email
  4. Set granular permissions

Troubleshooting Common Issues

Panel Not Loading

Solutions:

  • Verify database connection
  • Check application key is set
  • Review PHP error logs
  • Ensure Redis is accessible

Cannot Create Servers

Solutions:

  • Verify node is connected
  • Check Wings daemon status
  • Review allocation settings
  • Ensure Docker is running on node

Server Won’t Start

Solutions:

  • Check server logs in panel
  • Verify egg configuration
  • Ensure adequate resources
  • Check Docker image availability

Additional Resources

Conclusion

Deploying Pterodactyl Panel on Klutch.sh gives you a professional game server management interface that rivals commercial hosting panels. With support for dozens of games, comprehensive user management, and a modern interface, Pterodactyl makes running game servers accessible to everyone.

Combine the Panel on Klutch.sh with Wings on your gaming servers to create a complete game hosting infrastructure that you control.