Installing Pterodactyl on Fedora Server

Pterodactyl is a free and open-source game server management panel designed to provide a modern and secure interface to manage multiple game servers. This tutorial will guide you through the process of installing Pterodactyl on the latest version of Fedora Server.

Prerequisites

Before starting the installation process, you need to ensure that you have the following prerequisites on your Fedora Server:

Step 1: Install Dependencies

To install the required dependencies, run the following command in your terminal:

sudo dnf install -y tar unzip curl wget git composer npm

Step 2: Create the Pterodactyl User

Pterodactyl requires a dedicated user to run its processes. To create a new user named pterodactyl, run the following command in your terminal:

sudo useradd -m -d /var/www/pterodactyl -s /bin/bash pterodactyl

Step 3: Clone the Pterodactyl Repository

To download the latest version of Pterodactyl from GitHub, run the following commands in your terminal:

sudo su - pterodactyl
cd /var/www/pterodactyl
git clone https://github.com/pterodactyl/panel.git .

Step 4: Install Pterodactyl Dependencies

Before starting the installation of Pterodactyl, you need to install its dependencies. To do this, run the following command in your terminal:

composer install --no-dev --optimize-autoloader

Step 5: Configure the .env File

The .env file contains the environment variables used by Pterodactyl to manage its configuration. To generate a new .env file, run the following command in your terminal:

cp .env.example .env

Next, edit your .env file with your server details. Modify the following variables:

APP_URL=http://your-server-ip-address

DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=pterodactyl
DB_USERNAME=pterodactyl
DB_PASSWORD=your_database_password

MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

APP_KEY=

APP_ENV=production
APP_DEBUG=false

SESSION_DRIVER=file
CACHE_DRIVER=file
QUEUE_DRIVER=sync

Save and close the file.

Step 6: Install Pterodactyl Assets

Pterodactyl uses Laravel Mix to compile its assets. To install and compile the assets, run the following commands in your terminal:

npm install --production
npm run prod

Step 7: Prepare the Database

Before being able to use Pterodactyl, you need to create the database and run the database migrations. To do this, run the following commands in your terminal:

php artisan key:generate --force
php artisan migrate --seed --force

Step 8: Configure the Web Server

To configure your web server to serve Pterodactyl, create a new virtual host configuration file in your web server configuration directory. For Apache, this will typically be /etc/httpd/conf.d/. For nginx, this will typically be /etc/nginx/conf.d/.

For Apache, create a new file called pterodactyl.conf and insert the following configuration:

<VirtualHost *:80>
    ServerName your-server-ip-address

    DocumentRoot /var/www/pterodactyl/public
    <Directory /var/www/pterodactyl/public>
        AllowOverride none
        Require all granted
        RewriteEngine On
        RewriteRule ^(.*)$ index.php [PT,L]
    </Directory>

    ErrorLog /var/log/httpd/pterodactyl.error.log
    CustomLog /var/log/httpd/pterodactyl.access.log combined
</VirtualHost>

For nginx, create a new file called pterodactyl.conf and insert the following configuration:

server {
    listen 80;
    server_name your-server-ip-address;

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

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

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php-fpm/www.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }

    access_log /var/log/nginx/pterodactyl.access.log;
    error_log /var/log/nginx/pterodactyl.error.log;
}

Save and close the file, then restart your web server:

sudo systemctl restart httpd.service   # For Apache
sudo systemctl restart nginx.service   # For nginx

Step 9: Accessing Pterodactyl

Once the installation is complete, you can access the Pterodactyl web interface by visiting http://your-server-ip-address in your web browser.

Conclusion

Congratulations! You have successfully installed Pterodactyl on your Fedora Server. You can now start managing your game servers through the Pterodactyl web interface.

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!