How to Install Pterodactyl on MXLinux Latest

Pterodactyl is an open-source game server management panel that allows you to host many games with ease. In this tutorial, you will learn how to install Pterodactyl on MXLinux Latest.

Prerequisites

Before we proceed with the installation, it is essential to ensure that your system meets the following requirements:

Step 1: Update Your System

It is always important to ensure that your system is up to date before installing any new software. To do this, Open the terminal on your MXLinux Latest system and run the following command:

sudo apt update && sudo apt upgrade

Step 2: Install Required Dependencies

Next, we need to install some packages needed for the installation process to be successful by running the following command:

sudo apt-get install git curl tar unzip wget nano make gcc g++

Step 3: Install MariaDB

Pterodactyl requires a database management system to operate, so we will install MariaDB. Run the following command to install it.

sudo apt-get install mariadb-server

After installation of MariaDB, we need to secure it by running:

sudo mysql_secure_installation

Follow the prompts and make sure to enable all the recommended security measures.

Step 4: Install Node.js

Next, we need to install Nodejs, which is required to run Pterodactyl. Run the following command to install Node.js:

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

Step 5: Install Yarn Package Manager

Yarn is a package manager that we will use to install Pterodactyl dependencies. Run the following command to install the Yarn package manager:

curl -sL 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 update && sudo apt install yarn

Step 6: Clone Pterodactyl

Clone Pterodactyl to your system by running the following command:

git clone https://github.com/pterodactyl/panel.git /var/www/pterodactyl

Step 7: Install Pterodactyl Dependencies

Now that the Pterodactyl source code is on our system, we need to install its dependencies. Navigate to the installation directory using:

cd /var/www/pterodactyl

Once inside the directory, run:

npm install --only=production 

It will take a few minutes for the installation to complete.

Step 8: Configure Pterodactyl

We will now configure Pterodactyl. To start, navigate to the installation directory by running:

cd /var/www/pterodactyl 

Then, copy the ".env.example" file to ".env" using:

cp .env.example .env 

Next, generate an application key using:

php artisan key:generate --force 

Now, replace the following lines in the .env file with your own credentials:

APP_URL=http://yourdomain.tld:8000
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=panel
DB_USERNAME=pterodactyl
DB_PASSWORD=YOURPASSWORD

Save the changes and exit the editor.

Step 9: Configure Nginx

Finally, we need to configure the Nginx web server to serve the Pterodactyl control panel.

First, create a new Nginx configuration file:

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

Then, paste the following configuration into the file:

server {
    listen 80;
    server_name yourdomain.tld; # Change this to your domain name
    root /var/www/pterodactyl/public;
    index index.php index.html index.htm;

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

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php7.4-fpm.sock; # **Change Depending On Your PHP Version**
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
}

Save and exit the editor.

Next, create a symlink for our configuration:

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

Finally, restart Nginx to apply the changes:

sudo systemctl restart nginx

Your Pterodactyl installation is now complete. You can access it via the domain or IP address of the server.

Conclusion: Congratulations, you have successfully installed Pterodactyl on MXLinux Latest! You can now start hosting game servers with ease.

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!