How to Install Pterodactyl on NetBSD

Pterodactyl is a popular open-source game server management panel designed to make it easy to create, manage and monitor game servers. In this tutorial, we will guide you through the process of installing Pterodactyl on NetBSD.

Prerequisites

Before you begin with the installation, ensure that you have the following:

Step 1: Update and Upgrade the System

First, log in to your VPS via SSH using your root credentials. Once logged in, update and upgrade the system to ensure that you have the latest packages installed by running the following commands:

pkgin update
pkgin upgrade

Step 2: Install Required Dependencies

The next step is to install the dependencies required to run Pterodactyl. To do so, run the following command:

pkgin install php74-sockets php74-gd php74-mbstring php74-curl php74-pdo_mysql mysql-server

Step 3: Create a MySQL Database

After installing the packages, create a MySQL database and user for Pterodactyl to use.

mysql -u root -p

Enter your MySQL root password when prompted.

CREATE DATABASE pterodactyl;
CREATE USER 'pterodactyl'@'localhost' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON pterodactyl.* TO 'pterodactyl'@'localhost';
FLUSH PRIVILEGES;
exit

Replace <password> with a strong password for the Pterodactyl user.

Step 4: Install and Configure Nginx

Install Nginx using the following command:

pkgin install nginx

After installation, create a new Nginx configuration file for Pterodactyl.

nano /usr/pkg/etc/nginx/nginx.conf

Paste the following configuration into the file:

server {
    listen 80;
    server_name example.com;
    root /var/www/pterodactyl/public;
    index index.html index.htm index.php;
    access_log /var/log/nginx/pterodactyl.access.log;
    error_log /var/log/nginx/pterodactyl.error.log;
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
    location ~ /\.ht {
        deny all;
    }
}

Update example.com with your domain name or IP address. Save and exit the file by pressing CTRL + X, followed by Y and Enter.

Step 5: Install Pterodactyl

The next step is to install Pterodactyl using the following command:

curl -Lo panel.tar.gz https://github.com/pterodactyl/panel/releases/download/v1.4.4/panel.tar.gz
tar --strip-components=1 -xzvf panel.tar.gz
chmod -R 755 storage/* bootstrap/cache/

Step 6: Configure Pterodactyl

After installation, configure Pterodactyl by editing the .env file.

nano .env

Set the following values:

APP_ENV=production
APP_DEBUG=false
APP_URL=http://example.com

Update example.com with your domain name or IP address.

Enter your MySQL database details:

DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=pterodactyl
DB_USERNAME=pterodactyl
DB_PASSWORD=<password>

Replace <password> with the password you created for the MySQL user.

Save and exit the file by pressing CTRL + X, followed by Y and Enter.

Step 7: Install Node.js and Yarn

Install Node.js and Yarn using the following commands:

pkgin install nodejs-lts yarn

Step 8: Build the Pterodactyl Assets

After installing Node.js and Yarn, build the Pterodactyl assets using the following command:

yarn install --production --pure-lockfile
yarn run build --production

Step 9: Start PHP-FPM and Nginx

Start PHP-FPM and Nginx using the following commands:

svcadm enable php74-fpm
svcadm enable nginx

Step 10: Create an Admin User

Finally, create an admin user for Pterodactyl using the following command:

php artisan p:user:make

Follow the prompts to enter your details.

Conclusion

You have successfully installed Pterodactyl on NetBSD. You can now log in to your Pterodactyl panel and start creating game servers for your community.

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!