Deployment Overview of Pterodactyl Control Panel on Server¶
Prerequisites and Basic Requirements¶
To ensure a successful deployment, the following requirements must be met:
-
Operating System: Ubuntu (Jammy Jellyfish or newer).
-
Privileges: Root or sudo access is required for package installation and service management.
-
Domain Name: A valid FQDN pointing to the server IP is required for SSL certificate issuance via Certbot.
-
Ports: The following ports must be open in the firewall:
-
80/tcp: HTTP (for ACME challenges and redirection). -
443/tcp: HTTPS (for secure panel access). -
12333/tcp: Wings communication port.
FQDN of the final panel on the hostkey.in domain¶
The application uses a specific subdomain template for accessing the control panel:
| Parameter | Value |
|---|---|
| Prefix | pterodactyl |
| Domain | hostkey.in |
| Full template | pterodactyl{Server_ID_from_Invapi}.hostkey.in |
File and Directory Structure¶
The application and its associated services use the following directory structure:
-
/var/www/pterodactyl: Main installation directory for the Pterodactyl Panel. -
/root/nginx: Configuration files for the Nginx Docker container used for SSL management. -
/data/nginx/user_conf.d/: Custom Nginx configuration files for specific domains. -
/etc/letsencrypt/live/{Server_ID_from_Invapi}.hostkey.in/: Location of SSL certificates. -
/etc/cron.d/pterodactyl: System cron job for the application scheduler. -
/etc/systemd/system/pteroq.service: Systemd service file for the Pterodactyl Queue Worker.
Application installation process¶
The installation follows a multi-step process involving package management and manual configuration:
-
System Preparation: The system repositories are updated, and necessary dependencies including
curl,gnupg, andsoftware-properties-commonare installed. -
Repository Configuration: External repositories for PHP (Sury.org) and Redis are added to the system to ensure access to required versions.
-
Dependency Installation: The following core packages are installed via
apt: -
PHP 8.3 (including FPM, MySQL, CLI, and common modules).
-
MariaDB Server (Database).
-
Redis Server (Caching/Queue).
-
Nginx (Web server).
-
Composer (PHP dependency manager).
-
Certbot (SSL management).
-
Application Retrieval: The latest Pterodactyl Panel release is downloaded from GitHub, extracted to
/var/www/pterodactyl, and ownership is assigned to thewww-datauser. -
Environment Setup: A
.envfile is generated from the example template, and critical parameters (Timezone, App URL, Database credentials) are configured. -
Dependency Management: Composer is used to install all required PHP libraries within the application directory.
-
Database Initialization: The MariaDB database
panelis created, a dedicated user is assigned, and database migrations/seeding are executed via theartisancommand-line tool. -
Security Configuration: An administrative user is created to allow initial access to the panel.
Access Rights and Security¶
-
User Permissions: The application files in
/var/www/pterodactylare owned by thewww-datauser to ensure proper web server execution. -
Firewall: Only specific ports (
80,443,12333) are required for external traffic. -
Service Hardening: The Nginx configuration includes security headers and restricts access to hidden files (e.g.,
.htfiles).
Databases¶
The application utilizes MariaDB as its primary data store:
| Parameter | Value |
|---|---|
| Database Name | panel |
| Database User | pterodactyl |
| Connection Host | 127.0.0.1 |
| Port | 3306 |
Docker Containers and Their Deployment¶
The deployment utilizes a dedicated Docker container to manage SSL certificates through Nginx and Certbot:
-
nginx-certbot
-
Image:
jonasal/nginx-certbot:latest -
Ports: Uses
network_mode: host. -
Volumes:
-
nginx_secrets:/etc/letsencrypt(SSL certificates). -
/data/nginx/user_conf.d:/etc/nginx/user_conf.d(Custom Nginx configs). -
/var/www/pterodactyl/public:/var/www/pterodactyl/public:ro(Webroot for ACME challenges). -
Environment:
[email protected]. -
Restart Policy:
unless-stopped.
Custom Scripts and Additional Setup¶
The installation performs several non-standard system modifications to ensure application stability:
-
Queue Worker Service: A custom systemd service named
pteroqis created to manage the Pterodactyl Queue Worker (artisan queue:work). This ensures that background tasks (like sending emails or processing files) are processed continuously. -
Task Scheduler: A cron job is installed at
/etc/cron.d/pterodactylto execute the application's internal scheduler every minute. -
SSL Automation: Certbot is configured with a systemd timer (
certbot.timer) to handle automatic renewal of SSL certificates.
Application Update Instructions¶
To update the Pterodactyl Panel, follow these steps:
-
Navigate to the installation directory:
cd /var/www/pterodactyl. -
Download and extract the latest version over the existing files.
-
Run Composer to update dependencies:
-
Apply database migrations:
Location of configuration files and data¶
-
Application Environment:
/var/www/pterodactyl/.env -
Nginx Site Configurations:
/etc/nginx/sites-available/pterodactyl.conf -
Systemd Service (Queue):
/etc/systemd/system/pteroq.service -
Cron Configuration:
/etc/cron.d/pterodactyl
Available ports for connection¶
| Port | Protocol | Purpose |
|---|---|---|
80 | TCP | HTTP (Redirect to HTTPS) |
443 | TCP | HTTPS (Panel Access) |
12333 | TCP | Wings Communication |
Starting and Stopping the application¶
The following commands are used to manage the core background services:
-
Starting/Restarting the Queue Worker:
-
Managing Web Server (Nginx):
-
Managing Database (MariaDB):
Proxy Servers¶
The application uses Nginx as a reverse proxy. For SSL management, a Dockerized Nginx container handles the Let's Encrypt ACME challenges and manages certificates in /etc/letsencrypt. The main host-based Nginx service then serves the content via HTTPS using these certificates.