Skip to content

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:

  1. Installing system dependencies (PHP 8.3, MariaDB, Redis, Nginx).

  2. Downloading and extracting the panel source code.

  3. Configuring the environment via the .env file.

  4. Installing dependencies via composer.

  5. Running database migrations and creating an administrator.

Access Rights and Security

  • Application User: All files in the /var/www/pterodactyl directory belong to the www-data user and www-data group.

  • 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:

docker compose pull && docker compose up -d
Additionally, the panel may require a code update via 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 storage and bootstrap/cache directories must be writable by the www-data user.

  • All files in /var/www/pterodactyl belong to www-data:www-data recursively.

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-certbot Docker container.

  • SSL: TLSv1.2 and TLSv1.3 protocols are used.

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