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 within the hostkey.in zone is required for SSL and panel access.

  • Ports:

  • 80/tcp: HTTP (for ACME challenges and redirection).

  • 443/tcp: HTTPS (main application access).

  • 12333/tcp: Wings communication port.

  • 3306/tcp: MariaDB service.

  • 6379/tcp: Redis service.

FQDN of the final panel on the hostkey.in domain

The application uses a dynamic subdomain template for access:

Parameter Value
Prefix pterodactyl
Domain hostkey.in
Full template pterodactyl{Server_ID}.hostkey.in

File and Directory Structure

The application and its associated services are organized in the following locations:

  • Application Installation Directory: /var/www/pterodactyl

  • Nginx Configuration Directory: /etc/nginx/sites-available/ and /etc/nginx/sites-enabled/

  • Certbot/SSL Certificates: /etc/letsencrypt/live/{FQDN}/

  • Docker Nginx Management: /root/nginx/

Application Installation Process

The installation process follows a multi-step procedure to set up the environment, dependencies, and the application itself:

  1. System Preparation: The system package cache is updated, and essential tools such as curl, gnupg, and software-properties-common are installed.

  2. Repository Configuration:

  3. A PHP repository (Ondrej PPA) is added to provide the required PHP version (8.3).

  4. The Redis APT repository is configured via a dedicated GPG keyring.

  5. Dependency Installation: The following packages are installed:

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

  7. Web & Database: nginx, mariadb-server, and redis-server.

  8. System Utilities: composer, git, unzip, tar, and cron.

  9. Application Deployment:

  10. The latest Pterodactyl Panel release is downloaded from GitHub as a compressed archive.

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

  12. Composer dependencies are installed using composer install --no-dev --optimize-autoloader.

  13. Environment Configuration:

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

  15. Critical environment variables (APP_URL, Database credentials, Redis settings) are injected into the .env file.

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

  17. Database Setup:

  18. A MariaDB database named panel is created.

  19. A dedicated user pterodactyl is configured with appropriate privileges.

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

Access Rights and Security

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

  • Permissions:

  • Application directories use 0755.

  • Sensitive configuration files like .env use 0640 to restrict access.

  • Firewall/Service Security: The application utilizes a dedicated Nginx configuration that enforces HTTPS redirection and restricts access to hidden files (.ht).

Databases

The application uses MariaDB for persistent data storage:

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

Docker Containers and Their Deployment

The deployment utilizes a Docker container to manage SSL certificate acquisition via Certbot:

  • Nginx-Certbot Container

  • Image: jonasal/nginx-certbot:latest

  • Network Mode: host

  • Volumes:

  • /etc/letsencrypt: Shared with the host to manage SSL certificates.

  • /data/nginx/user_conf.d: Contains custom Nginx configurations.

  • /var/www/pterodactyl/public: Mounted as read-only for ACME challenges.

  • Environment Variables: CERTBOT_EMAIL is set for Let's Encrypt notifications.

  • Restart Policy: unless-stopped

Custom Scripts and Additional Setup

The following system-level configurations are applied to ensure application stability:

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

  • Queue Worker Service: A custom systemd service named pteroq is created and enabled. This service runs php artisan queue:work to handle background tasks (high, standard, and low priority queues).

Application Update Instructions

To update the Pterodactyl Panel application:

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

  2. Download and extract the latest release from GitHub over the existing files.

  3. Run Composer to update dependencies: php8.3 /usr/bin/composer install --no-dev --optimize-autoloader.

  4. Execute database migrations: php8.3 artisan migrate --force.

  5. Clear application caches: php8.3 artisan config:clear && php8.3 artisan route:clear && php8.3 artisan view:clear.

Location of Configuration Files and Data

  • Main Application Config: /var/www/pterodactyl/.env

  • Nginx Site Configs: /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 application relies on several system services. Use the following commands for management:

  • Main Web Service:

  • Start/Restart Nginx: systemctl restart nginx

  • Background Worker (Queue):

  • Restart Queue: systemctl restart pteroq

  • Database and Cache:

  • MariaDB: systemctl status mariadb

  • Redis: systemctl status redis-server

Proxy Servers

The deployment uses a dual-layer proxy approach:

  1. Nginx (Host): Acts as the primary web server, handling SSL termination via Let's Encrypt certificates and serving PHP requests to php-fpm via a Unix socket.

  2. Docker Nginx: A specialized container used specifically for automated SSL certificate management and ACME challenges.

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