arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to install pterodactyl
#1
So earlier I made a thread to explain about this new panel I found called Pterodactyl, here's a short description I wrote of it.
"Pterodactyl is a free, open-source game management panel which offers you many different games including but not limited to, Minecraft (including Spigot, Bungeecord, and Sponge), ARK: Evolution Evolved, CS:GO, Team Fortress 2, Insurgency, Teamspeak 3, Mumble. You can control all of these services from just one panel and the best part is that It's all totally free! Pterodactyl is based on docker and best choice whether you're a user, a network or a game service provider."

So as I decided to explain it, I thought It'd be even better to write here a short and helpful guide to help you actually install the panel as well!

Before you start using it, here's their license which you agree to when you install the panel.

Code:
Copyright (c) 2015 - 2018 Dane Everitt <[email protected]>.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


So starting the installation, you've to first understand that OpenVZ is not supported!

Do not install this panel if you've an openVZ based system, you must check this first otherwise It will not work.

If you're not sure if you've an openvz system or not, you could contact your host or if you got it from here then check the VPS Information Page

Furthermore Pterodactyl is designed to run on your own server, so you definitely need root for it.Pterodactyl is intended to be run from a root user. You should have root access to your server keeping in mind the end goal to run and utilize this board.When installing the panel, I expect you to have fundamental knowledge of linux as this panel requires you much more than simply copy paste of the commands to install it. If you have not worked with linux before than you most likely should learn that before installing a complex panel such as this.This panel is not a drag and drop panel for your server and It requires complex requirements for it to function properly.

Supported Operating Systems
  • Ubuntu Server 14.04(Trusty Tahr)
  • Ubuntu Server 16.04(Xenial Xerus)
  • CentOS 7
  • Debian 8
  • Debian 9

They do support all the systems provided above but they recommend Ubuntu 16.04 only as some of them may not provide with the latest packages or version of the required dependencies.

Dependencies:
  • PHP 7.2 with the following Extensions

   [i]-               - CLI- php7.2-cli[/i]
   [i]                - OpenSSL (included with packaged versions)[/i]
                   [i]- GD php7.2-gd[/i]
                   [i]- MySQL php7.2-mysql[/i]
                   [i]- PDO php7.2-pdo[/i]
                   [i]- MBString php7.2-mbstring[/i]
                   [i]- Tokenizer php7.2-tokenizer[/i]
                   [i]- BCMath php7.2-bcmath[/i]
                   [i]- DOM php7.2-xml or php7.2-dom[/i]
                   [i]- cURL  php7.2-curl[/i]
                   [i]- Zip php7.2-zip[/i]
MySQL >= 5.7 or MariaDB >= 10.1
Nginx, Apache, or Caddy
cURL curl
Tar tar
Unzip unzip
Redis redis-server
Git git

Below is an example command which will install all the required dependencies,

Code:
# Add "add-apt-repository" command
apt -y install software-properties-common

# Add additional repositories for PHP, Redis, and MariaDB
add-apt-repository -y ppa:ondrej/php
add-apt-repository -y ppa:chris-lea/redis-server
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

# Update repositories list
apt update

# Install Dependencies
apt -y install php7.2 php7.2-cli php7.2-gd php7.2-mysql php7.2-pdo php7.2-mbstring php7.2-tokenizer php7.2-bcmath php7.2-xml php7.2-fpm php7.2-curl php7.2-zip mariadb-server nginx curl tar unzip git redis-server
Downloading

Now that we are done with getting the dependencies, we need to install the actual panel itself.The first step is to create a folder where you're going to install the panel. you may choose  your own but if you are not sure how to, then follow this command,
Code:
mkdir -p /var/www/html/pterodactyl
cd /var/www/html/pterodactyl

After moving into that folder, download the panel using this command,

curl -Lo panel.tar.gz https://github.com/pterodactyl/panel/rel...nel.tar.gz

If you're an advanced user and want to make sure the file you downloaded was not intercepted or corrupted,  verify that the SHA256 Checksum is valid for the download. The SHA256 Checksum for [email protected] is
Code:
a904dc978e00bbec026d3c53d7bedefbc77ad722ddcdbfbb9cf4a51dc28e685a

Next, unzip the package using the the tar utility we installed earlier,

tar --strip-components=1 -xzvf panel.tar.gz

Next, Setup the file permissions so that panel can write logs and cache the required things without a problem,

chmod -R 755 storage/* bootstrap/cache


Installing


We're on the most crucial point of this tutorial now, we're going to install the panel itself now, since we've taken care of getting the dependencies as well as downloading the actual package.

Pterodactyl Panel makes use of Composer to install dependencies and get everything setup and running for you. In order to use composer, you will first need to install it.

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

Luckily, Pterodactyl automatically configures the database you've chosen for you, you just need to create an empty database and get the credentials written in a notepad or somewhere accessible because you will need it during the procedure.

Once you've the composer intalled, you just need to run the following command and the composer program will take care of the rest,

Code:
cp .env.example .env
composer install --no-dev

When you run the command above it will begin by installing all of the dependencies required by the panel into the vendor/ directory.

We then need to generate an application encryption key using the command below. You should only run this command once when installing the Panel.

Code:
php artisan key:generate --force

Notice:

The key you generated with the above command should never be disclosed to others, and you should store a secure copy of that key off-site in a secure manner. If you ever need to reinstall the Panel or migrate to a new server you will need to continue using this key to avoid losing encrypted information in the database.


Before continueing, make sure you've made an empty MySQL database which would be required very soon, and you also use a non root user while the installation proceeds.

The next thing we need to do is get our environment setup for the panel. To do this, run the commands below and follow the prompts.

Code:
php artisan p:environment:setup
php artisan p:environment:database

After you've configured the environment, we need to configure email handling. To do that, enter the command below and follow the prompts. If you would like to use PHP's mail() function simply select the mail option. You also have the option to use SMTP or an email delivery service.

Code:
php artisan p:environment:mail

We can now setup the database. This is an automatic process that only requires you enter the command below.

Code:
php artisan migrate

The command may confirm from you if you want to do this on a live environment, answer It yes for it to continue It's work.

Once the database is setup, we need to further add information to the database itself so run the following command,

Code:
php artisan db:seed

Finally, we need to create an admin account on the system. Run the command below and follow the prompts to do so.

Code:
php artisan p:user:make

Notice:

Passwords for the user must include mixed case, at least one number, and at least 8 characters. The script will fail otherwise.


The next step is to set the permissions of the files and folder to the user who is the incharge of the panel, you could use root here however It is not recommended, use a non root user and set the permissions like so,

For Nginx:

Code:
chown -R www-data:www-data *

# If using CentOS do:
chown -R nginx:nginx *

For Apache

Code:
chown -R www-data:www-data *

# If using CentOS do:
chown -R apache:apache *

Before configuring the web server, we need to setup some listeners which will allow the panel to do progress in the background and handle It's tasks more efficiently.Simply run sudo crontab -e and then enter the code below at the bottom.

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

Also make sure that cron is running by running sudo service cron start.

We then need to add a queue worker systemd script. To do so, create a file in /etc/systemd/system named pteroq.service, and paste the contents of the block below in it.

Ubuntu 14.04 Notice

If you are using Ubuntu 14.04 you cannot use this method to run your queue worker. Please see these instructions for installing Supervisor and setting up your queue. Ensure you use the same ExecStart line as below.


Code:
# Pterodactyl Queue Worker File
# ----------------------------------
# File should be placed in:
# /etc/systemd/system
#
# nano /etc/systemd/system/pteroq.service

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

[Service]
# On some systems the user and group might be different.
# Some systems use `apache` as the user and group.
User=www-data
Group=www-data
Restart=always
ExecStart=/usr/bin/php /var/www/html/pterodactyl/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3

[Install]
WantedBy=multi-user.target

Furthermore, you need to setup the cron service to autostart on boot, follow the commands below,

Code:
sudo systemctl enable pteroq.service
sudo systemctl start pteroq


Webserver Configuration!

If you were able to follow me up to this point, then be notified that we're on the last part of the installation process, we simply need to make the panel pubilically accessible


If you are using NGINX, follow this below you need to create a new file called "pterodactyl.conf"  and then replace <domain> with the IP or Fully Qualified Domain Name (e.x. panel.example.com) in the configuration file below.


This tutorial assumes that you will be using SSL on both the panel and daemons for significantly improved communication security between users and the panel. You will need to get a valid SSL certificate which can be done for free by using Let's Encrypt.


Pterodactyl.conf

Code:
# If using Ubuntu this file should be placed in:
# /etc/nginx/sites-available/
#
# If using CentOS this file should be placed in:
# /etc/nginx/conf.d/
#
server {
   listen 80;
   server_name <domain>;
   return 301 https://$server_name$request_uri;
}

server {
   listen 443 ssl http2;
   server_name <domain>;

   root /var/www/html/pterodactyl/public;
   index index.php;

   access_log /var/log/nginx/pterodactyl.app-access.log;
   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;

   # SSL Configuration
   ssl_certificate /etc/letsencrypt/live/<domain>/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/<domain>/privkey.pem;
   ssl_session_cache shared:SSL:10m;
   ssl_protocols TLSv1.2;
   ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
   ssl_prefer_server_ciphers on;
   
   add_header Strict-Transport-Security "max-age=15768000; preload;";
   add_header X-Content-Type-Options nosniff;
   add_header X-XSS-Protection "1; mode=block";
   add_header X-Robots-Tag none;
   add_header Content-Security-Policy "frame-ancestors 'self'";
   add_header X-Frame-Options DENY;

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

   location ~ \.php$ {
       fastcgi_split_path_info ^(.+\.php)(/.+)$;
       # the fastcgi_pass path needs to be changed accordingly when using CentOS
       fastcgi_pass unix:/var/run/php/php7.2-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;
       include /etc/nginx/fastcgi_params;
   }

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

Pterodactyl.conf(non http)
Code:
# If using Ubuntu this file should be placed in:
# /etc/nginx/sites-available/
#
# If using CentOS this file should be placed in:
# /etc/nginx/conf.d/
#
server {
   listen 80;
   server_name <domain>;
   
   root /var/www/html/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)(/.+)$;
       # the fastcgi_pass path needs to be changed accordingly when using CentOS
       fastcgi_pass unix:/var/run/php/php7.2-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;
   }
}

Depending on your PHP conformation you may need to change the fastcgi_pass variable star to point to a TCP port or a different Unix socket. This is especially the case for CentOS. The final step is to restart NGINX with the program line below.

Ubuntu

Code:
sudo ln -s /etc/nginx/sites-available/pterodactyl.conf /etc/nginx/sites-enabled/pterodactyl.conf

service nginx restart

CentOS:

Code:
systemctl restart php-fpm
systemctl restart nginx

If you face any type of errors, you can check more about it using nginx -t which will point out the main cause or root of the interruption.

If you are not using your webserver for for anything else, we highly recommend you remove the default nginx configuration, as it might expose your Pterodactyl installation location and reveals your .env file containing sensible information.
On Ubuntu 16.04 you can run rm -rf /etc/nginx/sites-enabled/default to disable the default configuration.



Webserver Configuration For Apache!

If you're using apache instead of nginx( I personally use apache too ^^) then you've to create a file called pterodactyl.conf with the contents below. Replace the <domain> placeholder with the IP of ur server or the fully qualified domain such as myserver.domain.com in the premade config below,

Code:
# If using Ubuntu, this file should be placed in:
#     /etc/apache2/sites-available
#
# If using CentOS this file should be placed in:
#     /etc/httpd/conf.d/
#
<VirtualHost *:80>
 ServerName <domain>
 DocumentRoot "/var/www/html/pterodactyl/public"
 AllowEncodedSlashes On
 php_value upload_max_filesize 100M
 php_value post_max_size 100M
 <Directory "/var/www/html/pterodactyl/public">
   AllowOverride all
 </Directory>
</VirtualHost>


Run the commands below to finish setting up Apache and start the webserver.

Ubuntu:

Code:
sudo ln -s /etc/apache2/sites-available/pterodactyl.conf /etc/apache2/sites-enabled/pterodactyl.conf

sudo a2enmod rewrite

systemctl restart apache2

CentOS

Code:
systemctl restart httpd

I'll once again warn you,

If you are not using your webserver for for anything else, we highly recommend you remove the default apache configuration, as it might expose your Pterodactyl installation location and reveals your .env file containing sensible information.
On Ubuntu 16.04 you can run rm -rf /etc/apache2/sites-enabled/default to disable the default configuration.


If you followed me till here, then congratulations you've done the first part of the panel! The panel will function now but for it to be
able to run servers we need to set up panel daemons which won't take this long.




Installing the Daemon

Now I'll try to summarize this portion as my hands are actually tired of writing so much, and I'm sure you are tired of following it as well!

The daemon utilizes Docker so you must make sure your system is compatible with Docker before you start installing. Like suggested intially, openvz is not supported so make sure you're using KVM.(Xen will not work as well.)

The Docker supports OS ranging from Ubuntu 14.04, 16.04, CentOS 7, Debian 8 and 9

If you're using Debian 8 however, It requires a kernel upgrade before you can install the panel.

Please be aware that OVH installs a modified kernel that does not support important docker features. If you use OVH check your kernel version by running uname -r. If your kernel ends in -xxxx-grs-ipv6-64 or -xxxx-mod-std-ipv6-64 you're probably using a non-supported kernel.

The two main dependencies of this daemon is Docker(as mentioned previously) and NodeJS

Please reference the official Docker documentation for how to install Docker CE on your server. Some quick links are listed below for commonly supported systems. To run docker on boot, simply run this command

Code:
For Ubuntu 16.04 & CentOS 7 : systemctl enable docker

Code:
If you're using ubuntu 14 then you can proceed.


Now the second part of dependencies, you need to install NodeJS

NodeJS is extremely easy to install as well, follow the commands provided below.


Ubuntu:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt -y install nodejs

CentOS:

curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
yum -y install nodejs

Additional Dependencies,

Ubuntu:

apt -y install tar unzip make gcc g++ python

CentOS 7:

yum -y install tar unzip make gcc gcc-c++ python

The last section of second part is to install the actual Daemon.

The first step for installing the daemon is to make sure we have the required directory structure setup. To do so, run the commands below.

mkdir -p /srv/daemon /srv/daemon-data
cd /srv/daemon

Next, you've to install the daemon files.

Follow the command below,

curl -Lo daemon.tar.gz https://github.com/pterodactyl/daemon/re...mon.tar.gz

Extract the downloaded archive, tar --strip-components=1 -xzvf daemon.tar.gz

and then install the daemon by, npm install --only=production

This command could take a few minutes to run depending on your system specifications.


Once you have installed the daemon and required components, the next step is to create a node on your installed Panel. Once you have done that there will be a tab called Configuration when you view the node.

Simply copy and paste the code block and paste it into a file called core.json in /srv/daemon/config/ and save it. You may also use the Auto-Deployment feature rather than manually creating the files.

You can install this in your daemon using nano or any other text editor of you choice:

sudo nano /srv/daemon/config/core.json
Now paste the copied config (right click when using Putty or CTRL + SHIFT + v when using a Linux console).

After this saving the config using CTRL + o. You can leave the editor using CTRL + x in the end.


To start your daemon simply move into the daemon directory (usually /srv/daemon) and run the command below which will start the daemon in foreground mode.

sudo npm start
Use CTRL + C to stop the running process.



And voila, your setup is completed, if you actually followed me till here I'll be quite amazed.

and let's not forget, some of the content above including the scripts, notices have been copied directly from their documentation as I felt they were quite explanatory itself, this took me around two hours to write, so I had to copy some of the text from their documentation, though most of it is written myself.I hope you enjoy the tutorial, I tried to make it as easy and short as I could but It still took such a long time to write.

If you've any issues, or questions you can post about them below!
Thanks to ShadowHosting and Post4VPS for my VPS 5!
#2
Nice tutorial buddy...
but at that panel we can host samp/cs1.6 servers too ? or only the game you mention....

Thanks to @Post4VPS & @Racknerd for Providing thier : VPS 2

#3
Hmm I tried the installation but it always fails on sqlnya
Is it in mariadb
Terminal
Solo Developer


Possibly Related Threads…
Thread
Author
Replies
Views
Last Post
1,563
05-09-2021, 04:39 PM
Last Post: deanhills

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting