How to Install Pterodactyl on POP! OS Latest

Pterodactyl is an open-source game server management panel that aims to provide a better way to host and manage game servers for multiple games. In this tutorial, we will show you how to install Pterodactyl on POP! OS Latest.

Prerequisites

Before starting the installation process, make sure you have:

Step 1: Update the System

Before we start installing anything on the system, we need to update the packages using the following command:

sudo apt-get update && sudo apt-get upgrade

Step 2: Install Dependencies

Pterodactyl requires some dependencies to function properly. Run the following command to install the required packages:

sudo apt-get install -y software-properties-common curl gnupg git gcc make g++

Step 3: Install Node.js

The latest version of Pterodactyl requires Node.js 12.x or 14.x. We will install version 14.x using the following commands:

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

Step 4: Install Yarn

Pterodactyl uses Yarn as its package manager. We will install Yarn using the following command:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn

Step 5: Install PHP

Pterodactyl requires PHP version 7.4 or later. We will install PHP along with some required packages using the following command:

sudo apt-get install -y php7.4 php7.4-cli php7.4-curl php7.4-gd php7.4-mbstring php7.4-mysql php7.4-xml php7.4-zip php7.4-pgsql php7.4-fpm php7.4-bcmath

Step 6: Install MariaDB

Pterodactyl requires a database to store its data. We will use MariaDB as our database using the following commands:

sudo apt-get install -y mariadb-server mariadb-client
sudo systemctl start mariadb
sudo systemctl enable mariadb

Once MariaDB is installed, run the following command to secure the installation:

sudo mysql_secure_installation

Step 7: Configure PHP

We need to configure PHP to work properly with Pterodactyl. Edit the php.ini file using the following command:

sudo nano /etc/php/7.4/cli/php.ini

Add the following lines to the end of the file:

max_input_time = 300
max_execution_time = 300
memory_limit = 512M
post_max_size = 100M
upload_max_filesize = 100M

Save and close the file.

Step 8: Install Composer

Pterodactyl uses Composer as its dependency manager. We will install Composer using the following commands:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Step 9: Install Pterodactyl

We will now download and install Pterodactyl using the following commands:

cd /var/www/html
sudo git clone https://github.com/pterodactyl/panel.git .
sudo chmod -R 755 storage/* bootstrap/cache/
sudo cp .env.example .env
sudo composer install --no-dev --optimize-autoloader
php artisan key:generate --force
php artisan p:environment:setup
php artisan p:environment:database
php artisan migrate --seed --force
php artisan p:environment:mail

Step 10: Configure Nginx

We will create a new Nginx server block for Pterodactyl. Create a new file called pterodactyl.conf using the following command:

sudo nano /etc/nginx/sites-available/pterodactyl.conf

Add the following configuration to the file:

server {
    listen 80;
    server_name example.com; # Replace with your domain name
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name example.com; # Replace with your domain name

    # SSL Settings

    ssl_certificate /path/to/cert;
    ssl_certificate_key /path/to/key;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;

    ssl_protocols TLSv1.3;
    ssl_prefer_server_ciphers off;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
    ssl_ecdh_curve secp384r1;

    # Panel Root

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

    # Serve the panel

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

    # Pass PHP to backend

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
        fastcgi_param APP_ENV production;
        include fastcgi_params;
    }

    # Other Settings

    client_max_body_size 100m;
    sendfile off;
}

Save and close the file.

Enable the new server block using the following command:

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

Step 11: Set Up Queue

Pterodactyl uses Queue to manage background tasks. Run the following command to start the Queue daemon:

php artisan queue:work --daemon --queue=high,default

Step 12: Create an Admin Account

Finally, we need to create an admin account to manage Pterodactyl. Run the following command:

php artisan p:user:make

Follow the instructions and enter the required details.

Congratulations! You have successfully installed Pterodactyl on POP! OS Latest. You can now log in to the panel using the admin account you just created and start hosting game servers.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!