Pterodactyl Server Deployment Overview¶
Prerequisites¶
The following system parameters are required for the application to function correctly:
-
Operating System: Ubuntu (recommended version
jammy). -
Access Rights: Superuser (
root) privileges for installing system packages and managing services. -
Ports:
-
80(HTTP) — for Certbot certificate validation and HTTPS redirection. -
443(HTTPS) — primary port for the control panel. -
12333(TCP/SSL) — port for communication with Wings.
-
FQDN of the final panel on hostkey.in domain¶
Access to the panel is provided via a dynamically generated subdomain.
| Parameter | Value |
|---|---|
| Prefix | pterodactyl |
| Domain | hostkey.in |
| Full Template | pterodactyl{Server_ID_from_Invapi}.hostkey.in |
File and Directory Structure¶
Main directories used in the system:
-
/var/www/pterodactyl— root directory of the Pterodactyl Panel application. -
/root/nginx— configuration files for the Nginx Docker container with Certbot. -
/etc/letsencrypt— SSL certificate storage. -
/etc/systemd/system/pteroq.service— Pterodactyl queue service file.
Application Installation Process¶
The deployment performs the installation of the latest available version of the Pterodactyl Panel from the GitHub repository. The process includes:
-
Installing system dependencies (PHP 8.3, MariaDB, Redis, Nginx).
-
Downloading and extracting the panel source code.
-
Configuring the environment via the
.envfile. -
Installing dependencies via
composer. -
Running database migrations and creating an administrator.
Access Rights and Security¶
-
Application User: All files in the
/var/www/pterodactyldirectory belong to thewww-datauser andwww-datagroup. -
PHP Security: Upload limits are configured (
upload_max_filesize=100M). -
Attack Protection: HTTPoxy attack protection is enabled in the Nginx configuration (parameter
fastcgi_param HTTP_PROXY "";). -
Firewall: It is recommended to open only ports 80, 443, and 12333.
Databases¶
A local MariaDB database is used for the panel operation.
| Parameter | Value |
|---|---|
| Database Name | panel |
| DB User | pterodactyl |
| Connection Host | 127.0.0.1:3306 |
Docker Containers and Execution¶
The system uses one auxiliary container for automatic SSL certificate management via Certbot.
Nginx-Certbot Container:
-
Image:
jonasal/nginx-certbot:latest -
Ports: Uses
network_mode: host. -
Volumes:
-
nginx_secrets:/etc/letsencrypt— for storing certificates. -
/data/nginx/user_conf.d:/etc/nginx/user_conf.d— custom Nginx configurations. -
/var/www/pterodactyl/public:/var/www/pterodactyl/public:ro— read-only access to panel static files for domain validation.
-
-
Environment Variables:
[email protected]. -
Restart Policy:
unless-stopped.
Application Update Instructions¶
Updates are performed by running pull commands and restarting containers:
git pull or re-extracting the archive followed by executing php artisan migrate commands. Permissions Settings¶
To ensure correct web server operation, the following permissions are set:
-
The
storageandbootstrap/cachedirectories must be writable by thewww-datauser. -
All files in
/var/www/pterodactylbelong towww-data:www-datarecursively.
Configuration Files and Data Location¶
-
Application Configuration:
/var/www/pterodactyl/.env -
Nginx Configuration (host):
/etc/nginx/sites-available/pterodactyl.conf -
Docker Compose Configuration:
/root/nginx/compose.yml
Available Connection Ports¶
| Port | Purpose | Protocol |
|---|---|---|
| 80 | HTTP (HTTPS redirection) | TCP |
| 443 | Pterodactyl Control Panel | TCP/SSL |
| 12333 | Wings API / WebSocket | TCP/SSL |
Starting and Stopping the Application¶
System service management is performed using the following commands:
-
Restart Queue (Worker):
systemctl restart pteroq -
Restart PHP-FPM:
systemctl restart php8.3-fpm -
Restart MariaDB:
systemctl restart mariadb -
Restart Redis:
systemctl restart redis-server
Proxy Servers¶
Nginx and Certbot are used together to ensure HTTPS operation:
-
Nginx (host): Acts as the primary proxy, handles SSL connections on port 443, and forwards requests to PHP-FPM via socket or TCP.
-
Certbot: Automatically obtains and renews Let's Encrypt certificates through the
nginx-certbotDocker container. -
SSL: TLSv1.2 and TLSv1.3 protocols are used.