Pterodactyl Panel & Wings
(German YouTube video showcasing the process)
For lazy people (inofficial script):
bash <(curl -s https://pterodactyl-installer.se)Installing the panel
Official documentation: https://pterodactyl.io/project/introduction.html
Install dependencies
sudo apt update -ysudo apt install ca-certificates apt-transport-https software-properties-common gnupg curl -ywget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpgecho "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.listsudo apt update -y && sudo apt upgrade -yapt -y install php8.1 php8.1-{cli,gd,mysql,pdo,mbstring,tokenizer,bcmath,xml,fpm,curl,zip} mariadb-server redis-server nginx tar unzip gitcurl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composerInstall the panel
mkdir -p /var/www/pterodactylcd /var/www/pterodactylcurl -Lo panel.tar.gz https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gztar -xzvf panel.tar.gzchmod -R 755 storage/* bootstrap/cache/sudo mariadbConfigure MariaDB
CREATE USER 'pterodactyl'@'localhost' IDENTIFIED BY 'PASSWORT';CREATE DATABASE panel;GRANT ALL PRIVILEGES ON panel.* TO 'pterodactyl'@'localhost' WITH GRANT OPTION;exitConfigure the panel
cp .env.example .envTRUSTED_PROXIES='<ip_reverse_proxy>'composer install --no-dev --optimize-autoloaderphp artisan key:generatephp artisan p:environment:setupphp artisan p:environment:databasephp artisan p:environment:mailphp artisan migrate --seedphp artisan p:user:makeThese commands make changes to the .env file.
With key:generate, a encrytion key is added which is used to encrypt the panel’s data.
Be sure to back this file up (e.g. store it in a password manager) to prevent data loss.
Modify the file permissions
The pterodactyl files have to be owned by the www-data user and group.
Create cronjob
A cronjob has to be created in order for scheduled tasks (e.g. updates) to work.
Edit the crontab:
crontab -eIn the editor, add the following cronjob to the end of the file:
* * * * * php /var/www/pterodactyl/artisan schedule:run >> /dev/null 2>&1Create a systemd service
For the queue worker of the panel, a systemd service has to be created.
nano /etc/systemd/system/pteroq.service[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.targetStart the services
systemctl enable --now redis-server
systemctl enable --now pteroq.serviceCreate an NGINX configuration
This configuration is an example without TLS. You should always use TLS in a production environment. This can be achieved with the use of a reverse proxy.
Disable default site
rm /etc/nginx/sites-enabled/defaultCreate a site for Pterodactyl
nano /etc/nginx/sites-available/pterodactyl.confserver {
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.3-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 available site to the enabled sites directory
ln -s /etc/nginx/sites-available/pterodactyl.conf /etc/nginx/sites-enabled/pterodactyl.confRestart NGINX
systemctl restart nginxInstall Wings
Install Docker
Docker kann entweder schnell über den folgenden Befehl installiert werden, aber sollte in Produktivumgebungen nach den Vorgaben in der offiziellen Docker-Dokumentation installiert werden.
Docker can be installed with the quick installation command shown below. This method is not recommended for production use, and you should refer to the official Docker installation documentation.
curl -sSL https://get.docker.com/ | CHANNEL=stable bashEnable Docker service
systemctl enable --now dockerEnable swap checks (optional, recommended)
Starting with kernel version 5.8, this configuration is the default; thus this section can be skipped. This example uses GRUB. The same configuration to the kernel commandline applies to other bootloaders e.g. systemd-boot.
nano /etc/default/grubModify the variable GRUB_CMDLINE_LINUX_DEFAULT:
GRUB_CMDLINE_LINUX_DEFAULT="swapaccount=1"Download and install Wings
Create a directory for Wings
mkdir -p /etc/pterodactylDownload the Wings executable
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")"Add execution permissions to the executable
chmod u+x /usr/local/bin/wingsConfigure Wings
There are two ways of configuring Wings:
- Automatic configuration via the command shown in the Pterodactyl web ui
- Manually through the config file at
/etc/pterodactyl/config.yml
Create and start Wings service
Create service
nano /etc/systemd/system/wings.serviceInsert service configuration:
[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.targetStart the service
systemctl enable --now wingsDone! Now the installation and configuration of the Pterodactyl Panel & Wings should be finished.