How to Install Pterodactyl Panel on a VPS: A Comprehensive Guide for Game Server Management

 

Pterodactyl is a popular open-source game server management panel used by server administrators to manage and host game servers. It provides a user-friendly interface for controlling multiple game servers and is designed to be lightweight, secure, and flexible. Below is a detailed tutorial on how to install and configure Pterodactyl on a Linux server, particularly useful for users running AnonVM or similar VPS setups.


Pterodactyl Panel Installation Guide

This guide will walk you through the installation process for Pterodactyl, including the necessary dependencies, configuration, and setup on a fresh Linux VPS. This setup is intended for users who want to host and manage game servers for multiple games like Minecraft, ARK: Survival Evolved, CS


System Requirements

Before beginning the installation process, ensure that your server meets the following requirements:

  • OS: Ubuntu 20.04 LTS or Debian 10/11
  • CPU: At least 2 vCPUs
  • RAM: 4 GB or more (8 GB recommended for smoother performance)
  • Disk: SSD with at least 10 GB free space (more for game data)
  • Internet: A stable connection with SSH access to your server

Step 1: Update Your Server

Ensure your system packages are up-to-date before starting the installation:

 
sudo apt update && sudo apt upgrade -y

Reboot the server if necessary:

 
sudo reboot

Step 2: Install Required Dependencies

You need several dependencies for Pterodactyl to function properly. Install them with the following command:

 
sudo apt install -y curl wget unzip git sudo software-properties-common apt-transport-https lsb-release ca-certificates

Step 3: Install Docker and Docker-Compose

Pterodactyl relies on Docker for containerizing game servers. Install Docker and Docker Compose:

  1. Install Docker:
 
sudo apt install -y docker.io
  1. Enable Docker to start at boot:
 
sudo systemctl enable docker
  1. Start Docker:
 
sudo systemctl start docker
  1. Install Docker Compose:
 
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose

Check the Docker Compose installation:

 
docker-compose --version

Step 4: Install Dependencies for Pterodactyl Panel

  1. Install PHP 8.1 and required PHP extensions:
 
sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install -y php8.1 php8.1-cli php8.1-fpm php8.1-mbstring php8.1-xml php8.1-curl php8.1-mysql php8.1-zip php8.1-bcmath php8.1-json php8.1-imagick
  1. Install Composer (PHP dependency manager):
 
curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer

Step 5: Download and Install Pterodactyl Panel

  1. Clone the Pterodactyl repository:
 
cd /var/www sudo git clone https://github.com/pterodactyl/panel.git pterodactyl
  1. Set correct file permissions:
 
sudo chown -R www-data:www-data /var/www/pterodactyl
  1. Navigate to the Pterodactyl directory:
 
cd /var/www/pterodactyl
  1. Install the necessary PHP dependencies:
 
composer install --no-dev --optimize-autoloader

Step 6: Configure the Environment

  1. Copy the .env.example file to .env:
 
cp .env.example .env
  1. Edit the .env file to set up your environment variables. You’ll need to configure the database settings and application URL. You can edit it using nano or any text editor:
 
nano .env

Make sure to modify:

  • APP_URL: Set it to your domain (e.g., https://yourdomain.com).
  • DB_HOST, DB_DATABASE, DB_USERNAME, DB_PASSWORD: Set up these variables based on your database configuration.

Step 7: Set Up the Database

  1. Install MariaDB (or MySQL):
 
sudo apt install mariadb-server mariadb-client
  1. Secure the MariaDB installation:
 
sudo mysql_secure_installation
  1. Create the Pterodactyl database and user:
 
sudo mysql -u root -p

Then in the MySQL shell:

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

Step 8: Set Up the Pterodactyl Panel

  1. Run the Pterodactyl installation command to set up the database and generate the encryption keys:
 
php artisan key:generate php artisan migrate --seed
  1. Create an admin user for the Pterodactyl Panel:
 
php artisan p:user:make

This will prompt you to set up your admin username, email, and password.


Step 9: Set Up Pterodactyl Daemon

The Pterodactyl panel communicates with game servers through a daemon (Wings). To install it:

  1. Download and install Wings:
 
mkdir /etc/pterodactyl cd /etc/pterodactyl wget https://github.com/pterodactyl/wings/releases/download/v1.6.0/wings-linux-amd64.tar.gz tar -xzvf wings-linux-amd64.tar.gz
  1. Create a configuration file for Wings:
 
sudo nano /etc/pterodactyl/config.yml

This file will need to be configured with your panel’s information, including the API key generated in the Pterodactyl Panel.

  1. Run Wings:
 
./wings

Step 10: Configure Nginx for the Panel

  1. Install Nginx:
 
sudo apt install nginx
  1. Create an Nginx server block for Pterodactyl:
 
sudo nano /etc/nginx/sites-available/pterodactyl

Add the following configuration (adjust domain and SSL settings as necessary):

nginx
 
server { listen 80; server_name yourdomain.com; root /var/www/pterodactyl/public; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.ht { deny all; } }
  1. Enable the site and restart Nginx:
 
sudo ln -s /etc/nginx/sites-available/pterodactyl /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx

Step 11: Final Setup

  1. Access the Pterodactyl Panel via your domain (e.g., http://yourdomain.com) and log in with the admin account you created.
  2. Start adding game servers and configuring settings like resources, user permissions, and server installations.

Conclusion

You’ve successfully installed Pterodactyl on your server! You can now manage your game servers with ease and provide a user-friendly panel to manage multiple games. Make sure to secure your installation with SSL certificates (using Let’s Encrypt or any other provider) and regularly update your server and Pterodactyl panel for improved security and performance.

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution