Deployment Overview of Pterodactyl Panel on Server¶
Prerequisites and Basic Requirements¶
The deployment environment requires a specific operating system configuration and user privileges to ensure compatibility with the application stack.
-
Operating System: Ubuntu 22.04 LTS (Release:
jammy). The installation process will fail on other distributions or versions. -
Privileges: Root access or
sudoprivileges are required to install system packages, manage systemd services, and configure the firewall. -
Timezone: The application is configured to use the
Europe/Amsterdamtimezone. -
Required Ports:
-
Port
80(HTTP) for initial access and SSL certificate validation. -
Port
443(HTTPS) for secure panel access. -
Port
12333(Wings Proxy) for game server management communication. -
Port
3306(MariaDB) for database connectivity. -
Port
6379(Redis) for caching and queue processing. -
Port
9000(PHP-FPM) for PHP processing (internal).
-
FQDN of the Final Panel¶
The Pterodactyl Panel is accessible via a custom domain on the hostkey.in infrastructure. The Fully Qualified Domain Name (FQDN) follows the specific naming convention based on the server identifier.
-
FQDN Format:
pterodactyl<Server ID>.hostkey.in -
Access URL:
https://pterodactyl<Server ID>.hostkey.in
File and Directory Structure¶
The application files, configuration, and data are stored in specific locations on the host filesystem.
-
Application Root:
/var/www/pterodactyl -
Web Root (Public):
/var/www/pterodactyl/public -
Storage Directory:
/var/www/pterodactyl/storage -
Bootstrap Directory:
/var/www/pterodactyl/bootstrap -
Nginx Configuration:
/etc/nginx/sites-available/pterodactyl.conf -
SSL Certificates: Managed within the Docker container at
/etc/letsencrypt/live/pterodactyl<Server ID>.hostkey.in -
Cron Jobs:
/etc/cron.d/pterodactyl -
Systemd Service Files:
/etc/systemd/system/pteroq.service -
Docker Compose Configuration:
/root/nginx/compose.yml
Application Installation Process¶
The Pterodactyl Panel is installed using the latest release binary, configured with a custom environment file, and integrated with local system services.
-
System Preparation:
-
Updates are applied to the
aptcache. -
Required repositories are added, including
ppa:ondrej/phpfor PHP 8.3 and the official Redis repository.
-
-
Dependency Installation:
- The following packages are installed:
php8.3and its extensions (cli,common,gd,mysql,mbstring,bcmath,xml,curl,zip,fpm),nginx,mariadb-server,redis-server,git,composer,curl,unzip, andcron.
- The following packages are installed:
-
Application Deployment:
-
The latest
panel.tar.gzarchive is downloaded from the Pterodactyl GitHub releases. -
The archive is extracted to
/var/www/pterodactyl. -
Composer dependencies are installed in production mode (
--no-dev,--optimize-autoloader).
-
-
Configuration:
-
The
.env.examplefile is copied to.env. -
The
APP_KEYis generated usingphp artisan key:generate. -
Environment variables are set non-interactively to configure the panel URL, timezone, and database credentials.
-
-
Database Initialization:
-
A MariaDB database named
panelis created. -
A user named
pterodactylis created with full privileges on thepaneldatabase. -
Database migrations and seeding are executed.
-
-
Admin User Creation:
- The first administrator account is created with the username
adminand the email address provided in the deployment variables.
- The first administrator account is created with the username
Access Rights and Security¶
Security configurations include firewall rules, user permissions, and SSL enforcement.
-
Web Server User: All application files and directories under
/var/www/pterodactylare owned by thewww-datauser and group. -
SSL Enforcement:
-
SSL is enabled using Let's Encrypt certificates via
certbot. -
HTTP traffic on port 80 is automatically redirected to HTTPS on port 443.
-
Modern TLS protocols (
TLSv1.2,TLSv1.3) and strong cipher suites are enforced.
-
-
Firewall and Access:
-
Default Nginx site is disabled.
-
Access to hidden files (starting with
.) is denied. -
The
pteroqservice runs as thewww-datauser.
-
-
PHP Security:
HTTP_PROXYenvironment variable is explicitly set to empty to prevent the HTTPoxy vulnerability.
Databases¶
The application utilizes a local MariaDB instance for data persistence and Redis for caching and queue management.
-
Database Engine: MariaDB (MySQL compatible).
-
Database Name:
panel. -
Database Host:
127.0.0.1. -
Database Port:
3306. -
Database User:
pterodactyl. -
Cache and Queue Driver: Redis.
-
Redis Host:
127.0.0.1. -
Redis Port:
6379. -
Redis Password: Not configured (null).
Docker Containers and Their Deployment¶
A Docker container is deployed to manage SSL certificates and proxy traffic for the Wings API endpoint.
-
Container Image:
jonasal/nginx-certbot:latest. -
Deployment Method:
docker composeusing the file located at/root/nginx/compose.yml. -
Network Mode:
host. -
Volumes:
-
nginx_secrets(external) mounted at/etc/letsencrypt. -
/data/nginx/user_conf.dmounted at/etc/nginx/user_conf.d. -
/var/www/pterodactyl/publicmounted read-only at/var/www/pterodactyl/public.
-
-
Environment Variables:
CERTBOT_EMAIL:[email protected].
-
Restart Policy:
unless-stopped.
Proxy Servers¶
Two proxy configurations are active: one on the host system for the main Panel interface and one inside the Docker container for the Wings proxy.
Host Nginx (Panel)¶
-
Configuration File:
/etc/nginx/sites-available/pterodactyl.conf. -
Ports: Listens on
80and443. -
Root Directory:
/var/www/pterodactyl/public. -
PHP Handler: FastCGI via Unix socket
/run/php/php8.3-fpm.sock. -
SSL Certificates: Managed automatically by Certbot via the Nginx plugin.
Docker Nginx (Wings Proxy)¶
-
Configuration Template:
templates/nginx.conf.j2(applied inside the container). -
Ports: Listens on
80(redirect) and443(SSL). -
SSL Certificates:
/etc/letsencrypt/live/pterodactyl<Server ID>.hostkey.in. -
Proxy Backend: Forwards PHP requests to
127.0.0.1:9000on the host. -
HTTP/2: Enabled.
Permission Settings¶
File and directory permissions are strictly set to ensure the web server can read and write necessary files while preventing unauthorized access.
| Path | Owner | Group | Permissions |
|---|---|---|---|
/var/www/pterodactyl | www-data | www-data | 0755 (Recursive) |
/var/www/pterodactyl/storage | www-data | www-data | 0755 |
/var/www/pterodactyl/bootstrap | www-data | www-data | 0755 |
/var/www/pterodactyl/bootstrap/cache | www-data | www-data | 0755 |
/root/nginx | root | root | 0755 |
/etc/nginx/sites-available/pterodactyl.conf | root | root | 0644 |
/etc/cron.d/pterodactyl | root | root | 0644 |
Location of Configuration Files and Data¶
The following files contain the core configuration for the application and its services.
-
Application Environment:
/var/www/pterodactyl/.env -
Nginx Site Config:
/etc/nginx/sites-enabled/pterodactyl.conf -
Cron Job:
/etc/cron.d/pterodactyl -
Queue Worker Service:
/etc/systemd/system/pteroq.service -
Docker Compose:
/root/nginx/compose.yml -
Wings Proxy Config: Managed within the Docker container context.
Available Ports for Connection¶
The following ports are open and configured for specific services on the server.
-
80: HTTP (Redirects to HTTPS).
-
443: HTTPS (Pterodactyl Panel Access).
-
12333: Wings Proxy (Game Server Management).
-
3306: MariaDB (Internal database access).
-
6379: Redis (Internal cache/queue access).
-
9000: PHP-FPM (Internal process communication).
Starting, Stopping, and Updating¶
The application relies on systemd for managing background services and docker compose for the proxy container.
-
Start Services:
-
Stop Services:
-
Restart Services:
-
Enable Services on Boot:
-
Docker Container Management: Navigate to
/root/nginxand execute: -
Update Application: To update the Pterodactyl Panel binary, download the latest release to
/tmp, extract it to/var/www/pterodactyl, and run: -
Schedule Tasks: The application scheduler is managed by a cron job located at
/etc/cron.d/pterodactyl, which executesphp /var/www/pterodactyl/artisan schedule:runevery minute.