DEV Community

Cover image for How to Install Pterodactyl Panel on Bare Metal: Build Your Game Server
Andrew Wiggins
Andrew Wiggins

Posted on • Originally published at irexta.com

How to Install Pterodactyl Panel on Bare Metal: Build Your Game Server

When users search the internet attempting to discover how to install Pterodactyl Panel in Ubuntu environments, they inevitably encounter tutorials pushing a single automated installation command. Relying blindly on third-party execution scripts is a dangerous operational habit. When the script inevitably fails or throws a catastrophic pterodactyl panel 500 server error, inexperienced operators possess zero knowledge regarding how to debug the underlying architecture.

To build a resilient, commercial-grade game hosting platform, you must understand the infrastructure layers completely. You must separate the web management interface from the containerization daemon, configure proper kernel accounting, and resolve network anomalies that automated installers simply ignore. This guide empowers systems engineers to execute professional manual deployments, ensuring absolute architectural sovereignty.


Step 1: Preparing the Infrastructure and Security

Before installing the application logic, you must secure the host environment. The panel requires a powerful database engine and a web service. More critically, the communication daemon operates on specific ports that must remain publicly accessible to serve real-time console metrics directly to your users.

The Web Socket Console Requirement: The execution daemon traditionally listens on port 8080. While it handles management panel communication, it also serves real-time console websocket connections directly to your gamers. Blocking this port globally destroys the live console feature, resulting in connection refused errors. You must open port 8080 publicly and rely on the native cryptographic token authentication built into the daemon to secure your infrastructure.

# Update system repositories and install foundational utilities
sudo apt update && sudo apt install -y curl wget unzip tar software-properties-common

# Install the core database engine and web server
sudo apt install -y mariadb-server nginx redis-server

# Secure the database installation establishing strict root credentials
sudo mysql_secure_installation

# Enforce strict firewall rules allowing web traffic, file transfers, and daemon websocket connections
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 2022/tcp
sudo ufw allow 8080/tcp
sudo ufw enable
Enter fullscreen mode Exit fullscreen mode

Step 2: Conquering the Internal Server Error

Modern releases of the management interface strictly require updated language environments. Furthermore, the most common reason administrators encounter application crashes immediately after installation involves catastrophic file ownership mistakes during the extraction phase.

The Root Ownership Trap: Extracting the application archive using superuser privileges assigns total file ownership to the root user. Your web server cannot read or write to these system files, causing massive internal server errors when it attempts to generate logs or cache session data. You must explicitly transfer directory ownership back to the web service user before proceeding.

# Add the optimized repository to access current language releases
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update

# Install the required language modules ensuring absolute compatibility
sudo apt install -y php8.3 php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip}

# Download and initialize the dependency manager globally
curl -sS [https://getcomposer.org/installer](https://getcomposer.org/installer) | sudo php -- --install-dir=/usr/local/bin --filename=composer

# Create the dedicated web directory and download the application archive
sudo mkdir -p /var/www/pterodactyl
cd /var/www/pterodactyl
sudo curl -Lo panel.tar.gz [https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz](https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz)
sudo tar -xzvf panel.tar.gz

# CRITICAL FIX: Establish proper web server ownership to prevent internal server errors
sudo chown -R www-data:www-data /var/www/pterodactyl/*
sudo chmod -R 755 storage/* bootstrap/cache/
Enter fullscreen mode Exit fullscreen mode

Step 3: Solving the Mixed Content Routing Anomaly

When routing traffic through secure encrypted certificates, users frequently report broken visual elements and insecure connection warnings. This mixed-content exception occurs because the backend application remains unaware that the frontend proxy handles encrypted traffic. You must explicitly pass protocol headers within your server block.

# Create the virtual host configuration file for the web server
sudo nano /etc/nginx/sites-available/pterodactyl.conf
Enter fullscreen mode Exit fullscreen mode

Insert the optimized server block including the critical protocol header inside the file:

server {
    listen 80;
    server_name panel.yourdomain.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name panel.yourdomain.com;
    root /var/www/pterodactyl/public;
    index index.php;

    # Include your secure certificate paths here
    # ssl_certificate /path/to/cert.pem;
    # ssl_certificate_key /path/to/key.pem;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;

        # CRITICAL FIX: Inform the backend regarding the active encryption scheme
        fastcgi_param HTTPS on;
        fastcgi_param HTTP_X_FORWARDED_PROTO $scheme;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}
Enter fullscreen mode Exit fullscreen mode

Step 4: Deploying the Execution Daemon

The true powerhouse of your infrastructure is the execution daemon known as Wings. This utility interacts directly with the containerization engine to isolate and allocate resources for individual game instances, preventing single heavy processes from crashing the entire bare-metal server.

# Install the core containerization engine securely
curl -sSL [https://get.docker.com/](https://get.docker.com/) | CHANNEL=stable bash
sudo systemctl enable --now docker

# Download the compiled execution daemon binary
sudo mkdir -p /etc/pterodactyl
curl -L -o /usr/local/bin/wings "[https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_amd64](https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_amd64)"
sudo chmod u+x /usr/local/bin/wings

# After generating your node configuration from the web panel, start the service
sudo systemctl enable --now wings
Enter fullscreen mode Exit fullscreen mode

Step 5: Defeating the NAT Loopback Disconnect

A notoriously frustrating scenario involves configuring your execution node only to witness a red offline indicator displaying continuously on your dashboard. Both services ping successfully, yet communication fails completely. This anomaly usually traces back to routing limitations, specifically the absence of hairpin network address translation (NAT Loopback) capabilities.

If your panel and execution daemon reside within the identical local network segment, they cannot communicate utilizing external domain names unless your routing hardware supports loopback protocols. To resolve this, you must either modify the local /etc/hosts file directly or configure the node connection settings to utilize internal IP addresses instead of external domains.


Step 6: Fixing the Zero Usage Statistics Bug

After successfully launching a game instance, administrators often notice their central processor and memory utilization graphs flatlining at absolute zero. This is not a standard system permission bug. It occurs because modern Linux kernels disable memory swap accounting within control groups (cgroups) by default.

To restore active monitoring telemetry, you must modify the core bootloader configuration enabling proper swap accounting and perform a full system reboot to apply the kernel parameters.

# Open the global boot loader configuration file
sudo nano /etc/default/grub
Enter fullscreen mode Exit fullscreen mode

Locate the default command line directive and append the swap account parameter:

GRUB_CMDLINE_LINUX_DEFAULT="swapaccount=1"
Enter fullscreen mode Exit fullscreen mode

Update the bootloader configuration and reboot the physical server:

sudo update-grub
sudo reboot
Enter fullscreen mode Exit fullscreen mode

The iRexta Bare Metal Advantage

Running interactive multiplayer simulations demands aggressive clock speeds and uninhibited network pathways. Deploying game servers onto shared, virtualized cloud instances introduces devastating input lag due to noisy neighbor resource contention.

To deliver professional-tier latency and sustain massive concurrent player counts, you must migrate your operations to iRexta Bare Metal Dedicated Servers. You secure absolute physical processor isolation, massive direct-attached solid-state throughput, and the raw computational authority required to host flawless premium gaming experiences globally.


Game Server Infrastructure: FAQ

How do I fix the pterodactyl panel 500 server error?

This catastrophic failure typically occurs due to missing folder permissions after extracting the archive as the root user. You must execute a change ownership (chown) command ensuring the web user (www-data) owns the entire application directory so the system can write cache and log files properly.

Why is my node showing a red heart marking it offline?

A red offline indicator means the management interface cannot reach the daemon. This happens when your local network lacks loopback routing capabilities preventing internal domain resolution, or if your execution daemon is failing to boot securely.

How to fix mixed content issues when forcing secure connections?

If your browser warns about insecure elements while loading the encrypted interface, your reverse proxy configuration is incomplete. You must explicitly pass the forwarded protocol header inside your web server block, instructing the application that the traffic is actively encrypted.

Why are my game server CPU and RAM graphs showing zero?

This specific statistical bug occurs because modern kernel architectures disable memory swap accounting within control groups. To restore active monitoring telemetry, you must modify your bootloader configuration file to enable swap accounting and perform a full system reboot.


Ready to Build Your Infrastructure? Come Check It Out!

To access complete setup layouts, deep configuration parameters, and premium architectural blueprints, check out the live hub directly on our site.

👉 Click here to read the full Pterodactyl Panel installation tutorial directly on iRexta.com!

Top comments (0)