Skip to content

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:

  1. System Preparation: The system repositories are updated, and necessary dependencies including curl, gnupg, and software-properties-common are installed.

  2. Repository Configuration: External repositories for PHP (Sury.org) and Redis are added to the system to ensure access to required versions.

  3. Dependency Installation: The following core packages are installed via apt:

  4. PHP 8.3 (including FPM, MySQL, CLI, and common modules).

  5. MariaDB Server (Database).

  6. Redis Server (Caching/Queue).

  7. Nginx (Web server).

  8. Composer (PHP dependency manager).

  9. Certbot (SSL management).

  10. Application Retrieval: The latest Pterodactyl Panel release is downloaded from GitHub, extracted to /var/www/pterodactyl, and ownership is assigned to the www-data user.

  11. Environment Setup: A .env file is generated from the example template, and critical parameters (Timezone, App URL, Database credentials) are configured.

  12. Dependency Management: Composer is used to install all required PHP libraries within the application directory.

  13. Database Initialization: The MariaDB database panel is created, a dedicated user is assigned, and database migrations/seeding are executed via the artisan command-line tool.

  14. 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/pterodactyl are owned by the www-data user 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., .ht files).

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 pteroq is 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/pterodactyl to 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:

  1. Navigate to the installation directory: cd /var/www/pterodactyl.

  2. Download and extract the latest version over the existing files.

  3. Run Composer to update dependencies:

    php8.3 /usr/bin/composer install --no-dev --optimize-autoloader
    

  4. Apply database migrations:

    php artisan migrate --force
    

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:

    systemctl restart pteroq
    

  • Managing Web Server (Nginx):

    systemctl restart nginx
    

  • Managing Database (MariaDB):

    systemctl restart 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.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×