IN AFRICA

ALBANIA

ARGENTINA

AUSTRALIA

AUSTRIA

AZERBAIJAN

B AND H

BANGLADESH

BELGIUM

BRAZIL

BULGARIA

CANADA

CHILE

CHINA

COLOMBIA

COSTA RICA

CROATIA

CYPRUS

CZECH

DENMARK

ECUADOR

EGYPT

EL SALVADOR

ESTONIA

FINLAND

FOR BACKUP AND STORAGE

FOR DATABASE

FOR EMAIL

FOR MEDIA STREAMING

FRANCE

GEORGIA

GERMANY

GREECE

GUATEMALA

HUNGARY

ICELAND

IN ASIA

IN AUSTRALIA

IN EUROPE

IN NORTH AMERICA

IN SOUTH AMERICA

INDIA

INDONESIA

IRELAND

ISRAEL

ITALY

JAPAN

KAZAKHSTAN

KENYA

KOSOVO

LATVIA

LIBYA

LITHUANIA

LUXEMBOURG

MALAYSIA

MALTA

MEXICO

MOLDOVA

MONTENEGRO

MOROCCO

NETHERLANDS

NEW ZEALAND

NIGERIA

NORWAY

PAKISTAN

PANAMA

PARAGUAY

PERU

PHILIPPINES

POLAND

PORTUGAL

QATAR

ROMANIA

RUSSIA

SAUDI ARABIA

SERBIA

SINGAPORE

SLOVAKIA

SLOVENIA

SOUTH AFRICA

SOUTH KOREA

SPAIN

SWEDEN

SWITZERLAND

TAIWAN

THAILAND

TUNISIA

TURKEY

UK

UKRAINE

UNITED ARAB EMIRATES

URUGUAY

USA

UZBEKISTAN

VIETNAM

How to Install and Secure Pterodactyl Panel on Ubuntu Bare Metal

A comprehensive step-by-step guide to installing, configuring, and securing Pterodactyl Panel and Wings on Ubuntu bare-metal servers. Learn how to turn unmanaged dedicated infrastructure into a high-performance game hosting platform with Docker container isolation and SSL protection.

Pterodactyl Panel on Ubuntu Bare Metal

Pterodactyl is an open-source game server management panel built on PHP, React, and Go. Unlike traditional web control panels, Pterodactyl runs all game instances in isolated Docker containers, preventing resource starvation and protecting the host operating system from malicious game mods or exploits. This guide provides an end-to-end walkthrough for deploying both the web management Panel and the Wings node daemon on bare-metal Ubuntu servers, complete with database setup, web server configuration, SSL encryption, and security hardening.

What You'll Learn

Prerequisites & System Requirements

Before starting the installation, ensure your bare-metal server meets the following criteria:

  • Operating System: Clean install of Ubuntu 24.04 LTS or 22.04 LTS (64-bit).

  • Access Level: Direct root SSH access or a user account with full sudo privileges.

  • Hardware Specs: Minimum 2 GB RAM (4 GB+ recommended when running Panel and Wings on the same host).

  • Domain & DNS: A Fully Qualified Domain Name (FQDN), such as panel.yourdomain.com, with an A record pointing to your server's public IPv4 address.

  • Virtualization: KVM or Bare Metal (OpenVZ, LXC, and Virtuozzo are not supported by Docker without custom kernel flags).

Step 1: System Preparation & Installing Dependencies

  1. Update the local system repositories and upgrade existing packages to ensure a clean base environment:

    Bash
    
    sudo apt update && sudo apt upgrade -y
    sudo apt install -y software-properties-common curl ca-certificates gnupg tar unzip git lsb-release
                                            
  2. Add the official Ondřej Surý PHP repository to access the latest PHP packages and extensions:

    Bash
    
    sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
    sudo apt update
                                            
  3. Install Nginx, MariaDB, Redis, and PHP 8.3 with all required extensions for Pterodactyl:

    Bash
    
    sudo apt install -y nginx mariadb-server redis-server \
      php8.3 php8.3-{cli,common,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip,intl,tokenizer}
                                            
  4. Verify that all essential services are enabled and active:

    Bash
    
    sudo systemctl enable --now nginx mariadb redis-server php8.3-fpm
                                            
  5. Install Composer, the PHP dependency manager:

    Bash
    
    curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
    composer --version
                                            

Step 2: Database and Caching Setup

  1. Run the security script for MariaDB to set a root password, remove anonymous users, and disable remote root logins:

    Bash
    
    sudo mysql_secure_installation
                                            
  2. Log in to the MariaDB shell:

    Bash
    
    sudo mariadb -u root -p
                                            
  3. Create the Pterodactyl database and a dedicated user restricted to local connections:

    SQL
    
    CREATE DATABASE panel;
    CREATE USER 'pterodactyl'@'127.0.0.1' IDENTIFIED BY 'SelectAStrongPasswordHere';
    GRANT ALL PRIVILEGES ON panel.* TO 'pterodactyl'@'127.0.0.1';
    FLUSH PRIVILEGES;
    EXIT;
                                            
  4. Verify that Redis caching is working by running a ping test:

    Bash
    
    redis-cli ping
    # Expected output: PONG
                                            

Step 3: Downloading and Configuring Pterodactyl Panel

  1. Create the web root directory for the Panel and navigate into it:

    Bash
    
    sudo mkdir -p /var/www/pterodactyl
    cd /var/www/pterodactyl
                                            
  2. Download and extract the latest release archive from GitHub:

    Bash
    
    sudo curl -Lo panel.tar.gz https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz
    sudo tar -xzvf panel.tar.gz
    sudo chmod -R 755 storage bootstrap/cache
                                            
  3. Copy the example environment configuration file and install PHP dependencies:

    Bash
    
    sudo cp .env.example .env
    sudo COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --optimize-autoloader
    sudo php artisan key:generate --force
                                            

    Crucial Backup Step: Save your generated APP_KEY from /var/www/pterodactyl/.env in a secure location off-site. Losing this key makes encrypted data unrecoverable.

  4. Run Pterodactyl's interactive configuration wizards:

    Bash
    
    sudo php artisan p:environment:setup
    sudo php artisan p:environment:database
    sudo php artisan p:environment:mail
                                            
  5. Run database migrations to initialize tables and default data, then create your administrative account:

    Bash
    
    sudo php artisan migrate --seed --force
    sudo php artisan p:user:make
                                            
  6. Grant ownership of the files to the web server user:

    Bash
    
    sudo chown -R www-data:www-data /var/www/pterodactyl/*
                                            

Step 4: Web Server & SSL Certificate Setup with Nginx

  1. Create a new Nginx site configuration file:

    Bash
    
    sudo nano /etc/nginx/sites-available/pterodactyl.conf
                                            
  2. Paste the following configuration block, replacing panel.yourdomain.com with your domain:

    Nginx
    
    server {
        listen 80;
        server_name panel.yourdomain.com;
        root /var/www/pterodactyl/public;
        index index.php;
    
        client_max_body_size 100m;
        client_body_timeout 120s;
    
        sendfile off;
    
        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;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param HTTP_PROXY "";
            fastcgi_intercept_errors off;
            fastcgi_buffer_size 16k;
            fastcgi_buffers 4 16k;
            fastcgi_connect_timeout 300;
        }
    }
                                            

Frequently Asked Questions

Can I use virtualization like OpenVZ for Pterodactyl?

OpenVZ, LXC, and Virtuozzo are not supported by Docker without custom kernel flags. KVM or Bare Metal is required.

Do I need a domain name to install Pterodactyl?

Yes, a Fully Qualified Domain Name (FQDN) like panel.yourdomain.com with an A record pointing to your server is required for SSL termination and secure communication.

What are the minimum hardware requirements for Pterodactyl?

A minimum of 2 GB RAM is required, but 4 GB or more is highly recommended when running both the management Panel and the Wings daemon on the same host.

Discover iDatam Dedicated Server Locations

iDatam servers are available around the world, providing diverse options for hosting websites. Each region offers unique advantages, making it easier to choose a location that best suits your specific hosting needs.

Up