Pterodactyl - (Game)Server panel

November 13, 2021 20:48

Install the panel

# As first we need PHP 8.0+ on Debian ([reference](
sudo apt install apache2 php8.0 redis-server

# Install needed php modules
sudo apt -y install php8.0 php8.0-{cli,gd,mysql,pdo,mbstring,tokenizer,bcmath,xml,fpm,curl,zip} tar unzip git redis-server
sudo a2enmod php8.0

# Install composer
curl -sS | sudo php -- --install-dir=/usr/local/bin --filename=composer

Now modify 000-default.conf to point to the correct (Pterodactyl) directory (e.g. /var/www/pterodactyl/public) Also make sure to insert this:

# To allow .htaccess inside the pages root dir
    <Directory /var/www/pterodactyl>
        AllowOverride All

And allow the webserver to access it:

sudo chown www-data -Rv /var/www/pterodactyl
sudo -u www-data bash

Now get the files according to this

cp .env.example .env
composer install --no-dev --optimize-autoloader
php artisan key:generate --force

php artisan p:environment:setup

-> insert this:

[email protected]

Setup the db:

php artisan p:environment:database

-> insert this:

Setup the mail:

php artisan p:environment:mail

-> insert this:

pteroda[email protected]
[email protected]
php artisan migrate --seed --force
php artisan p:user:make

-> insert this:


And make sure the files permissions are correct (again):

sudo chown www-data -Rv /var/www/pterodactyl

Also add on the webserver the cronjob…

sudo -u www-data crontab -e

-> append this:

* * * * * php /var/www/pterodactyl/artisan schedule:run >> /dev/null 2>&1

…AND the queue worker (which sends out the emails) - see here. Now enable all the services:

sudo systemctl enable --now redis-server
sudo systemctl enable --now pteroq.service

I would also strongly recommend to install a weekly reboot job, to migitate stuck queue jobs (e.g. after updating the panel some PHP stuff may get stuck):

@weekly /usr/sbin/reboot

Install any reverse proxy

On your (existing) apache reverse proxy vm run:

sudo a2enmod rewrite

Now setup your reverse proxy as always… Here are some notes regarding this (for Apache):

  • Must enable ProxyPreserveHost
  • Run
    sudo a2enmod remoteip
  • Add to the VirtualHost
    RemoteIPHeader X-Client-IP
    RemoteIPHeader X-Forwarded-For
    RequestHeader set X-Forwarded-Proto https

Now add to the Pterodactyl config (the .env file):


Setup your first wings (panel)

  • Add a new location
  • Add a new node “[FQDN_OF_THE_NODE]”, fqdn=[FQDN_OF_THE_NODE], daemon-port=[RANDOM_PORT_NUMBER], stfp-port=[RANDOM_PORT_NUMBER], …
  • These random ports MUST BE publicy exposed!
  • Create new ip allocations - e.g.:
    •, wildcard, 8733
    • [INTERNAL_VM_IP], internal, 2341 -> Internal tests
    •, localhost, 20392 -> for Bungeecord
  • I really recommend creating a trunk allocation with ~256 ports.

Setup your first wings (vm)

Mainly use this:

mkdir -p /etc/pterodactyl
curl -L -o /usr/local/bin/wings
chmod u+x /usr/local/bin/wings

Now install the config from the panel & start manually with --debug. Also mount some letsencrypt certs into the vm to /etc/letsencrypt, so wings can use them (just obtain them on your reverse proxy using a redirect)… Final notes:

  • When getting CORS errors, make sure (e.g. via curl) you can reach wings using the FQDN - maybe the config is messed up and uses the wrong ports…
  • When getting DNS erros on server start: Check the wings config for correct DNS servers - maybe even correct them!
  • I mounted via NFS all server data to /var/lib/pterodactyl

MINIO for server backups

Just slap a new docker-compose.yml together with:

version: '3'
        image: minio/minio
        restart: always
            - [PATH_TO_ALL_YOUR_BACKUP_DATA]:/data
            MINIO_REGION_NAME: 'default'
            MINIO_ROOT_USER: 'root'
            - [RANDOM_PORT]:9000
        command: server /data

Now login to the ui (which runs on the same port) and create a new bucket called pterodactyl.

Finally extend the .env config once again:

# Sets your panel to use s3 for backups

# Info to actually use s3

And here is a working demo for RUST:

Now navigate to the Build configuration of your server(s) and enter an allowed backup count to enable this feature.


  • I cloned the wings vm for one instance without any NFS integration (as needed for e.g. Starbound - as it locks the world, which is unsupported by NFS)