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└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM ghcr.io/pterodactyl/panel:latest
# Set environment variablesENV APP_ENV=productionENV APP_DEBUG=falseENV 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:
# ApplicationAPP_ENV=productionAPP_DEBUG=falseAPP_KEY=APP_TIMEZONE=UTCAPP_URL=https://your-app-name.klutch.sh
# DatabaseDB_CONNECTION=mysqlDB_HOST=your-db-hostDB_PORT=3306DB_DATABASE=pterodactylDB_USERNAME=pterodactylDB_PASSWORD=your-db-password
# RedisREDIS_HOST=your-redis-hostREDIS_PORT=6379REDIS_PASSWORD=null
# Cache and SessionCACHE_DRIVER=redisSESSION_DRIVER=redisQUEUE_CONNECTION=redis
# MailMAIL_MAILER=smtpMAIL_HOST=smtp.example.comMAIL_PORT=587MAIL_USERNAME=nullMAIL_PASSWORD=nullMAIL_ENCRYPTION=tlsMAIL_FROM_ADDRESS=noreply@example.comMAIL_FROM_NAME="Pterodactyl Panel"
# Trusted ProxiesTRUSTED_PROXIES=*Creating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdLICENSE.gitignore*.log.DS_Store.envDeploying Pterodactyl on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 80
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the Pterodactyl Panel container
- Provision an HTTPS certificate
Generate Application Key
Generate a secure application key:
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:
git initgit add Dockerfile .env.example .dockerignoregit commit -m "Initial Pterodactyl Panel deployment configuration"git remote add origin https://github.com/yourusername/pterodactyl-deploy.gitgit push -u origin mainCreate 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:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
APP_ENV | production |
APP_DEBUG | false |
APP_KEY | Your generated application key |
APP_URL | https://your-app-name.klutch.sh |
APP_TIMEZONE | UTC |
DB_CONNECTION | mysql |
DB_HOST | Your database host |
DB_DATABASE | pterodactyl |
DB_USERNAME | Your database user |
DB_PASSWORD | Your database password |
REDIS_HOST | Your Redis host |
CACHE_DRIVER | redis |
SESSION_DRIVER | redis |
QUEUE_CONNECTION | redis |
TRUSTED_PROXIES | * |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/app/var | 5 GB | Application cache and logs |
/app/storage | 10 GB | File storage |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Run Database Migrations
After deployment, run database setup commands:
php artisan migrate --seed --forceCreate Admin User
Create your administrator account:
php artisan p:user:makeAccess 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
- In the Panel, go to Admin > Nodes
- Create a new node with server details
- Copy the auto-deployment script
- Run on your node server
curl -L -o /usr/local/bin/wings "https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_amd64"chmod u+x /usr/local/bin/wingsConfiguring Wings
- Copy configuration from Panel (Admin > Nodes > Configuration)
- Save to
/etc/pterodactyl/config.yml - Start Wings as a service
Creating Game Servers
Adding an Egg
- Go to Admin > Nests
- Import or create eggs for your games
- Configure startup commands and Docker images
Creating a Server
- Go to Admin > Servers > Create New
- Select owner and node
- Choose nest and egg
- Configure resource limits
- Set startup parameters
- Create server
Resource Allocation
| Resource | Recommendation |
|---|---|
| CPU | 100-200% per core |
| Memory | Based on game requirements |
| Disk | Based on game size |
| Swap | 50% of memory |
User Management
Creating Users
- Go to Admin > Users
- Click “Create New”
- Set email and password
- Assign admin permissions if needed
Server Subusers
Allow server owners to add collaborators:
- Go to server management
- Click “Users” tab
- Add subuser email
- 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
- Pterodactyl Official Website
- Pterodactyl Panel Documentation
- Wings Installation Guide
- Pterodactyl GitHub Repository
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
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.