How to Install Pterodactyl on FreeBSD Latest

Pterodactyl is a free, open-source game server management panel that allows you to control and monitor your game servers easily. This guide will take you through the installation process for Pterodactyl on FreeBSD Latest.

Prerequisites

Before starting with the installation process, make sure the following requirements are met:

Step 1: Install Dependencies

The first step is to install some dependencies required by Pterodactyl. You can install them using the following command:

sudo pkg install -y curl tar bash git
sudo pkg install -y python3 python3-pip python3-virtualenv

Step 2: Install MariaDB

Next, you need to install MariaDB which is a free, open-source relational database server. You can install it using the following command:

sudo pkg install -y mariadb104-server

After installation, start the MariaDB service and enable it to start at boot:

sudo sysrc mysql_enable=yes
sudo service mysql-server start

Then, secure the MariaDB installation by running the following command:

sudo mysql_secure_installation

Follow the prompts and set a secure password for the root user.

Step 3: Install Node.js

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Pterodactyl requires Node.js to run. You can install it using the following command:

sudo pkg install -y node14 npm

Step 4: Create Pterodactyl User

Create a new user named "pterodactyl" with the following command:

sudo adduser -q pterodactyl -s /bin/bash -m -d /var/www/pterodactyl

Step 5: Install the Panel

Login as the "pterodactyl" user:

sudo su - pterodactyl
cd /var/www/pterodactyl

Then, download the latest version of Pterodactyl Panel from Github using the following command:

curl -Lo panel.tar.gz https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz

Extract the downloaded archive using the following command:

tar --strip-components=1 -xzvf panel.tar.gz
chmod -R 755 storage/* bootstrap/cache/
cp .env.example .env

Edit the ".env" file and provide appropriate values for the following variables:

APP_URL=http://your-domain.com          # Replace this with your actual domain name or public IP address
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=pterodactyl
DB_USERNAME=pterodactyl
DB_PASSWORD=yourpassword                # Replace this with a secure password

Save and close the file.

Next, install the dependencies and optimize your installation:

php composer install --no-dev --optimize-autoloader
php artisan key:generate --force
php artisan p:environment:setup
php artisan p:environment:database

Finally, run the following command to install the panel:

php artisan migrate --seed --force

Step 6: Install the Daemon

The Pterodactyl daemon runs on each game server and communicates with the panel to handle tasks such as server start/stop. Login as the root user and create a new user named "pterodactyl-daemon" using the following command:

sudo adduser -q pterodactyl-daemon -s /bin/bash -m

Download the latest version of Pterodactyl Daemon from Github using the following command:

cd /root
curl -Lo daemon.tar.gz https://github.com/pterodactyl/daemon/releases/latest/download/daemon.tar.gz
tar --strip-components=1 -xzvf daemon.tar.gz
chmod +x ./wings
cp /root/config/config.example.yml /etc/pterodactyl/config.yml

Edit the "config.yml" file and provide appropriate values for the following variables:

# ...
token: your-unique-daemon-secret                            # Replace this with a secret key
# ...
mysql:
  host: db                                                # Use the hostname or IP address of your database server
  port: 3306
  database: pterodactyl
  username: pterodactyl
  password: yourpassword                                   # Replace this with the password you set for the pterodactyl user
# ...

Save and close the file.

Then, install the dependencies:

sudo pkg install -y gcc g++ make automake autoconf openssl-dev 
cd /root
curl -sL https://github.com/openssl/openssl/archive/OpenSSL_1_1_1h.tar.gz \
| tar xfz -
cd openssl-OpenSSL_1_1_1h
./config shared
gmake -j$(nproc)
sudo gmake install

Next, compile and install the daemon:

cd /root
./wings install

Start the daemon using the following command:

sudo service wings start

Check the status of the daemon:

sudo service wings status

If the installation is successful, the daemon should be running and ready to receive tasks from the panel.

Step 7: Log in to the Pterodactyl Panel

Open up your web browser and go to the URL you specified in the ".env" file. You should see the Pterodactyl login page. Use the default login details:

You should change the password immediately after login.

Congratulations! You have successfully installed Pterodactyl on FreeBSD Latest. You can now add game servers to your panel and manage them easily.

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!