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 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:
-
System Preparation: The system updates the
aptcache and installs essential dependencies includingsoftware-properties-common,curl, andgnupg. -
Repository Configuration:
-
Adds the
sury.orgPHP repository to support PHP 8.3. -
Adds the official Redis repository.
-
Dependency Installation: The following packages are installed via
apt: -
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. -
Web Server:
nginx. -
Database:
mariadb-server. -
Caching/Queue:
redis-server. -
Other Tools:
composer,git,unzip,tar,cron, andcertbot. -
Panel Installation:
-
The latest Pterodactyl Panel release is downloaded from GitHub as a
.tar.gzarchive. -
The archive is extracted to
/var/www/pterodactyl. -
Environment Setup:
-
A
.envfile is generated from the example template. -
Application environment variables (Timezone:
Europe/Amsterdam, Cache/Session Driver:redis) are configured. -
An application key is generated using
php artisan key:generate. -
Database Initialization:
-
A MariaDB database named
paneland a userpterodactylare created. -
Database migrations and initial seeding are executed via
php artisan migrate --seed.
Access Rights and Security¶
-
User Permissions: The
/var/www/pterodactyldirectory and its subdirectories (storage,bootstrap/cache) are owned by thewww-datauser and group. -
Service Isolation: A dedicated systemd service
pteroqis created to run the Pterodactyl queue worker under thewww-datauser. -
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
hostnetwork 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/pterodactylto run the Pterodactyl scheduler every minute as thewww-datauser. -
Queue Worker Service: A custom systemd service named
pteroqis 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:
-
Navigate to the installation directory:
-
Download the latest version of the panel and extract it over the existing files (ensure you have a backup first).
-
Update dependencies:
-
Run database migrations:
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.logand/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:
-
Stopping all services:
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.