Pterodactyl Panel & Wings

(The YouTube video is in German)

For you lazy people (nonofficial Script):

bash <(curl -s https://pterodactyl-installer.se)
Installing the panel:

Official documentation: https://pterodactyl.io/project/introduction.html

Installing the dependencies:

apt update -y
apt install ca-certificates apt-transport-https software-properties-common gnupg curl -y
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee
 /etc/apt/sources.list.d/sury-php.list
wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add -
apt update -y && apt upgrade -y
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
apt update -y && apt upgrade -y
apt -y install php8.1 php8.1-{cli,gd,mysql,pdo,mbstring,tokenizer,bcmath,xml,fpm,curl,zip}
mariadb-server redis-server nginx tar unzip git
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

Installing the panel itself:

mkdir -p /var/www/pterodactyl
cd /var/www/pterodactyl
curl -Lo panel.tar.gz https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz
tar -xzvf panel.tar.gz
chmod -R 755 storage/* bootstrap/cache/

Configuring MariaDB:

mariadb -u root -p

Enter these SQL statements into to MariaDB shell:

CREATE USER 'pterodactyl'@'localhost' IDENTIFIED BY 'PASSWORT';
CREATE DATABASE panel;
GRANT ALL PRIVILEGES ON panel.* TO 'pterodactyl'@'localhost' WITH GRANT OPTION;
exit

Configure the panel:

cp .env.example .env

Modify the file for use with a reverse proxy:

nano .env

Modify:
TRUSTED_PROXIES='ip_reverse_proxy'

Run configuration wizard:

composer install --no-dev --optimize-autoloader
php artisan key:generate
php artisan p:environment:setup
php artisan p:environment:database
php artisan p:environment:mail
php artisan migrate --seed
php artisan p:user:make

It’s recommended to back up the .env file, because it contains your encryption key that is necessary to be able to restore data or migrate the panel to another instance.

Transfer the ownership to the ‘www-data’ user:

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

Set up a Cronjob for update checks, backups and other scheduled tasks:

crontab -e

I recommend using nano as the editor, because I find it most intuitive and easy to use. Paste the following line in the editor window below the last line at the bottom:

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

Create a service for the panel:

nano /etc/systemd/system/pteroq.service

Paste the following in the editor window:

[Unit]
Description=Pterodactyl Queue Worker
After=redis-server.service

[Service]
User=www-data
Group=www-data
Restart=always
ExecStart=/usr/bin/php /var/www/pterodactyl/artisan queue:work -queue=high,standard,low --sleep=3 --tries=3
StartLimitInterval=180
StartLimitBurst=30
RestartSec=5s

[Install]
WantedBy=multi-user.target

Enable the required services:

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

Configure NGINX without TLS: (Please refer to the official documentation for setup with TLS)

rm /etc/nginx/sites-enabled/default
nano /etc/nginx/sites-available/pterodactyl.conf

Paste the following in the editor window: (Replace “example.com” with your domain)

server {

    listen 80;
    server_name example.com;


    root /var/www/pterodactyl/public;
    index index.html index.htm index.php;
    charset utf-8;

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

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/pterodactyl.app-error.log error;

    # allow larger file uploads and longer script runtimes
    client_max_body_size 100m;
    client_body_timeout 120s;

    sendfile off;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
        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;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
    }

    location ~ /\.ht {
        deny all;
    }
}

Link the config and restart NGINX:

ln -s /etc/nginx/sites-available/pterodactyl.conf /etc/nginx/sites-enabled/pterodactyl.conf
systemctl restart nginx

The panel install is finished!

Installing Wings:

Installing docker and enabling the service:

curl -sSL https://get.docker.com/ | CHANNEL=stable bash
systemctl enable --now docker

Enable docker to use swap space (optional step):

nano /etc/default/grub

Replace GRUB_CMDLINE_LINUX_DEFAULT with:

GRUB_CMDLINE_LINUX_DEFAULT="swapaccount=1"

Download and install Wings:

mkdir -p /etc/pterodactyl
curl -L -o /usr/local/bin/wings "https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")"
chmod u+x /usr/local/bin/wings

Configure Wings manually:

Alternatively: Paste the auto deploy command shown in the panel

nano /etc/pterodactyl/config.yml

Paste the contents of the config shown in the panel

Create a service for Wings:

nano /etc/systemd/system/wings.service

Paste the service config:

[Unit]
Description=Pterodactyl Wings Daemon
After=docker.service
Requires=docker.service
PartOf=docker.service

[Service]
User=root
WorkingDirectory=/etc/pterodactyl
LimitNOFILE=4096
PIDFile=/var/run/wings/daemon.pid
ExecStart=/usr/local/bin/wings
Restart=on-failure
StartLimitInterval=180
StartLimitBurst=30
RestartSec=5s

[Install]
WantedBy=multi-user.target

Enable the Wings service:

systemctl enable --now wings

That’s it, you’re done installing Pterodactyl Panel and Wings. Have fun setting up your game servers.

Leave a Reply

Your email address will not be published. Required fields are marked *