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 (specifically jammy version).

  • Privileges: Root or sudo access is required for package installation and service management.

  • Domain: A valid FQDN pointing to the server IP is required for SSL/TLS encryption.

  • Ports: The following ports must be open on the firewall:

  • 80 (HTTP)

  • 443 (HTTPS)

  • 12333 (Wings communication)

FQDN of the final panel on the hostkey.in domain

The application uses a specific subdomain template for access.

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 utilize the following directory structure:

  • /var/www/pterodactyl: Main installation directory for the Pterodactyl Panel.

  • /root/nginx: Configuration directory for the Nginx Certbot container.

  • /data/nginx/user_conf.d/: Directory containing custom Nginx proxy configurations.

  • /etc/letsencrypt/live/{Server_ID_from_Invapi}.hostkey.in/: Location of SSL certificates.

Application installation process

The installation follows a multi-step process involving package management and manual configuration:

  1. System Preparation: The system updates the apt cache and installs essential dependencies including software-properties-common, curl, and gnupg.

  2. Repository Configuration:

  3. Adds the sury.org PHP repository to support PHP 8.3.

  4. Adds the official Redis repository.

  5. Dependency Installation: The following packages are installed via apt:

  6. PHP 8.3: php8.3, php8.3-fpm, php8.3-mysql, php8.3-gd, php8.3-mbstring, php8.3-xml, php8.3-curl, php8.3-zip, and others.

  7. Web Server: nginx.

  8. Database: mariadb-server.

  9. Caching/Queue: redis-server.

  10. Other Tools: composer, git, unzip, tar, cron, and certbot.

  11. Panel Installation:

  12. The latest Pterodactyl Panel release is downloaded from GitHub as a .tar.gz archive.

  13. The archive is extracted to /var/www/pterodactyl.

  14. Environment Setup:

  15. A .env file is generated from the example template.

  16. Application environment variables (Timezone: Europe/Amsterdam, Cache/Session Driver: redis) are configured.

  17. An application key is generated using php artisan key:generate.

  18. Database Initialization:

  19. A MariaDB database named panel and a user pterodactyl are created.

  20. Database migrations and initial seeding are executed via php artisan migrate --seed.

Access Rights and Security

  • User Permissions: The /var/www/pterodactyl directory and its subdirectories (storage, bootstrap/cache) are owned by the www-data user and group.

  • Service Isolation: A dedicated systemd service pteroq is created to run the Pterodactyl queue worker under the www-data user.

  • SSL/TLS: The application is configured to enforce HTTPS via Nginx redirects.

Databases

The application uses MariaDB for data storage.

Component Detail
Database Name panel
Database User pterodactyl
Connection Host 127.0.0.1:3306
Storage Location Managed by MariaDB system paths

Docker Containers and Their Deployment

The deployment utilizes a Docker container to manage SSL certificate renewals via Certbot.

  • nginx-certbot

  • Image: jonasal/nginx-certbot:latest

  • Ports: Uses host network mode.

  • Volumes:

  • nginx_secrets:/etc/letsencrypt

  • /data/nginx/user_conf.d:/etc/nginx/user_conf.d

  • /var/www/pterodactyl/public:/var/www/pterodactyl/public:ro

  • Restart Policy: unless-stopped

Custom Scripts and Additional Setup

The following custom configurations are applied during setup:

  • Cron Job: A system cron job is installed at /etc/cron.d/pterodactyl to run the Pterodactyl scheduler every minute as the www-data user.

  • Queue Worker Service: A custom systemd service named pteroq is configured to ensure the background queue worker (artisan queue:work) stays running and restarts automatically if it fails.

Application Update Instructions

To update the Pterodactyl Panel, perform the following steps:

  1. Navigate to the installation directory:

    cd /var/www/pterodactyl
    

  2. Download the latest version of the panel and extract it over the existing files (ensure you have a backup first).

  3. Update dependencies:

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

  4. Run database migrations:

    php8.3 artisan migrate --force
    

Location of configuration files and data

  • Application Configuration: /var/www/pterodactyl/.env

  • Nginx Site Configurations:

  • /etc/nginx/sites-available/pterodactyl.conf

  • /etc/nginx/sites-enabled/pterodactyl.conf

  • Logs: /var/log/nginx/pterodactyl-access.log and /var/log/nginx/pterodactyl-error.log

Available ports for connection

Port Service Purpose
80 HTTP Web traffic (Redirects to HTTPS)
443 HTTPS Main Panel Access
12333 Wings/Proxy Communication for Pterodactyl Wings

Starting and Stopping the application

The following commands are used to manage the core services:

  • Starting all services:

    systemctl start nginx mariadb redis-server php8.3-fpm pteroq
    

  • Stopping all services:

    systemctl stop nginx mariadb redis-server php8.3-fpm pteroq
    

Proxy Servers

The application uses Nginx as a reverse proxy to handle SSL termination and route traffic to the PHP-FPM service running on the host via a Unix socket (/run/php/php8.3-fpm.sock). Certbot is utilized within a Docker container to automate the acquisition and renewal of Let's Encrypt certificates for the FQDN.

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