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
jammyversion). -
Privileges: Root or sudo access is required for package installation and service management.
-
Domain: A valid FQDN within the
hostkey.inzone 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:
-
System Preparation: The system package cache is updated, and essential tools such as
curl,gnupg, andsoftware-properties-commonare installed. -
Repository Configuration:
-
A PHP repository (Ondrej PPA) is added to provide the required PHP version (
8.3). -
The Redis APT repository is configured via a dedicated GPG keyring.
-
Dependency Installation: The following packages are installed:
-
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. -
Web & Database:
nginx,mariadb-server, andredis-server. -
System Utilities:
composer,git,unzip,tar, andcron. -
Application Deployment:
-
The latest Pterodactyl Panel release is downloaded from GitHub as a compressed archive.
-
The archive is extracted to
/var/www/pterodactyl. -
Composer dependencies are installed using
composer install --no-dev --optimize-autoloader. -
Environment Configuration:
-
A
.envfile is generated from the example template. -
Critical environment variables (APP_URL, Database credentials, Redis settings) are injected into the
.envfile. -
An application key is generated using
php artisan key:generate. -
Database Setup:
-
A MariaDB database named
panelis created. -
A dedicated user
pterodactylis configured with appropriate privileges. -
Database migrations and initial data seeding are executed via
php artisan migrate --seed.
Access Rights and Security¶
-
File Ownership: The application directory
/var/www/pterodactyland its subdirectories (storage,bootstrap/cache) are owned by thewww-datauser and group. -
Permissions:
-
Application directories use
0755. -
Sensitive configuration files like
.envuse0640to 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_EMAILis 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/pterodactylto run the Laravel scheduler every minute as thewww-datauser. -
Queue Worker Service: A custom systemd service named
pteroqis created and enabled. This service runsphp artisan queue:workto handle background tasks (high, standard, and low priority queues).
Application Update Instructions¶
To update the Pterodactyl Panel application:
-
Navigate to the installation directory:
cd /var/www/pterodactyl. -
Download and extract the latest release from GitHub over the existing files.
-
Run Composer to update dependencies:
php8.3 /usr/bin/composer install --no-dev --optimize-autoloader. -
Execute database migrations:
php8.3 artisan migrate --force. -
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:
-
Nginx (Host): Acts as the primary web server, handling SSL termination via Let's Encrypt certificates and serving PHP requests to
php-fpmvia a Unix socket. -
Docker Nginx: A specialized container used specifically for automated SSL certificate management and ACME challenges.