Installing Pterodactyl on Arch Linux

Step 1: Update the System

First, make sure your system is up to date:

sudo pacman -Syu

Step 2: Install Required Dependencies

Pterodactyl requires several dependencies. Install them using pacman:

sudo pacman -S nginx mariadb nodejs npm redis php php-fpm php-gd php-mbstring php-mysql php-intl composer unzip git

Step 3: Configure MariaDB

Start and enable the MariaDB service:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Secure your MariaDB installation:

sudo mysql_secure_installation

Create a database and user for Pterodactyl:

CREATE DATABASE pterodactyl;
CREATE USER 'pterodactyl'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON pterodactyl.* TO 'pterodactyl'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 4: Install Pterodactyl Panel

Download and extract Pterodactyl:

cd /var/www
sudo git clone https://github.com/pterodactyl/panel.git pterodactyl
cd pterodactyl
sudo git checkout tags/v1.0.0
sudo cp .env.example .env

Install Composer dependencies:

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

Generate the application key:

sudo php artisan key:generate --force

Set up environment variables in .env file:

APP_ENV=production
APP_DEBUG=false
APP_KEY=base64:generated_app_key
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=pterodactyl
DB_USERNAME=pterodactyl
DB_PASSWORD=your_password

Run the database migrations and seed the database:

sudo php artisan migrate --seed --force

Set file permissions:

sudo chown -R www-data:www-data /var/www/pterodactyl
sudo chmod -R 755 /var/www/pterodactyl/storage /var/www/pterodactyl/bootstrap/cache

Step 5: Configure Web Server

Edit your Nginx configuration:

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

Add the following configuration:

server {
    listen 80;
    server_name your_domain_or_ip;

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

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

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTP_PROXY "";
        fastcgi_intercept_errors on;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
        fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
    }

    location ~ /\.ht {
        deny all;
    }
}

Enable the site and restart Nginx:

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

Step 6: Configure PHP-FPM

Edit PHP-FPM configuration:

sudo nano /etc/php/php-fpm.d/www.conf

Ensure the following lines are set:

user = www-data
group = www-data
listen.owner = www-data
listen.group = www-data

Restart PHP-FPM:

sudo systemctl restart php-fpm

Step 7: Finalize Setup

Access your Pterodactyl panel via your web browser at http://your_domain_or_ip and follow the web-based installer to complete the setup.

Step 8: Install Pterodactyl Daemon (Wings)

Download and install Wings:

cd /etc/pterodactyl
sudo curl -Lo wings https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_amd64
sudo chmod +x wings

Create a service file for Wings:

sudo nano /etc/systemd/system/wings.service

Add the following configuration:

[Unit]
Description=Pterodactyl Wings Daemon
After=network.target

[Service]
User=root
WorkingDirectory=/etc/pterodactyl
ExecStart=/etc/pterodactyl/wings
Restart=always
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target

Start and enable Wings:

sudo systemctl enable --now wings

Conclusion

By following these steps, you should have Pterodactyl installed and running on your Arch Linux system. Make sure to replace placeholders like your_password and your_domain_or_ip with your actual details.

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!