Pterodactyl-Installing

How to Install and Fully Configure Pterodactyl on Your VPS

How to Install and Fully Configure Pterodactyl on Your VPS: A Complete Guide



1. Introduction

Pterodactyl is a powerful game server management panel that allows you to manage multiple game servers easily. Setting it up on a VPS provides a flexible and cost-effective way to deploy and manage game servers. This guide covers everything you need to know to install and configure Pterodactyl on your VPS.

2. Prerequisites

VPS Requirements

  • CPU: At least 1 core (2 or more recommended)
  • RAM: Minimum 1 GB (2 GB or more for better performance)
  • Storage: SSD recommended for faster read/write speeds

Domain Name

A domain name is required for accessing the Pterodactyl panel. You can purchase a domain or use a subdomain pointing to your VPS IP address.

3. Setting Up Your VPS – How to Install and Fully Configure Pterodactyl on Your VPS

Choosing the Operating System

Pterodactyl supports Ubuntu 20.04 or Debian 10. This guide will focus on installing it on Ubuntu 20.04.

Step 1: Log in to your VPS via SSH: bash ssh username@your_vps_ip

Install Required Packages

sudo apt update && sudo apt upgrade -y  
sudo apt install software-properties-common curl wget -y

4. Installing Docker

Pterodactyl uses Docker to run game servers.

Step 1: Install Docker: bash curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh
Step 2: Add your user to the Docker group: bash sudo usermod -aG docker $USER
Step 3: Log out and back in to apply the group changes.

5. Installing Pterodactyl Panel

Downloading the Panel

Step 1: Install required PHP extensions: bash sudo apt install php php-fpm php-mysql php-mbstring php-xml php-curl php-zip php-gd -y

Step 2: Download Pterodactyl Panel: bash cd /var/www curl -Lo pterodactyl.zip https://github.com/pterodactyl/panel/archive/refs/heads/master.zip unzip pterodactyl.zip mv panel-master pterodactyl cd pterodactyl

Configuring Environment Variables – Install Pterodactyl

Step 1: Copy the example environment file: bash cp .env.example .env

Step 2: Edit the .env file with your preferred text editor: bash nano .env Set your database connection details and other preferences.

Running the Installation Script

Step 1: Install Composer: bash curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer

Step 2: Install dependencies: bash composer install --no-dev

Step 3: Generate the application key: bash php artisan key:generate

Step 4: Run the database migrations: bash php artisan migrate --seed

6. Setting Up Pterodactyl Wings (Daemon)

The Wings daemon manages the communication between the panel and the game servers.

Downloading and Configuring Wings

Step 1: Download Wings: bash cd /var mkdir wings cd wings curl -Lo wings.tar.gz https://github.com/pterodactyl/wings/releases/latest/download/wings-linux-amd64.tar.gz tar -xvzf wings.tar.gz

Step 2: Create the Wings configuration file: bash cp wings.config.yml.example wings.config.yml nano wings.config.yml Set the panel configuration and the database connection details.

Running Wings as a Service

Step 1: Create a systemd service file: bash sudo nano /etc/systemd/system/wings.service

Step 2: Add the following contents: “`ini
[Unit] Description=Pterodactyl Wings Daemon
After=network.target

[Service] User=root
WorkingDirectory=/var/wings
ExecStart=/var/wings/wings
Restart=always

[Install] WantedBy=multi-user.target
“`

Step 3: Start and enable the Wings service: bash sudo systemctl start wings sudo systemctl enable wings

7. Configuring the Database

Set up a MySQL database for Pterodactyl:

Step 1: Install MySQL: bash sudo apt install mysql-server -y

Step 2: Secure your MySQL installation: bash sudo mysql_secure_installation

Step 3: Create a database and user for Pterodactyl: sql CREATE DATABASE pterodactyl; CREATE USER 'ptero'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON pterodactyl.* TO 'ptero'@'localhost'; FLUSH PRIVILEGES;

8. Setting Up the Web Server

Nginx Configuration

Step 1: Install Nginx: bash sudo apt install nginx -y

Step 2: Create a new Nginx configuration file: bash sudo nano /etc/nginx/sites-available/pterodactyl

Step 3: Add the following configuration: “`nginx
server { listen 80; server_name your_domain.com;

root /var/www/pterodactyl/public;

index index.php index.html index.htm;

location / {
    try_files $uri $uri/ @rewrite;
}

location @rewrite {
    rewrite ^ /index.php?$args;
}

location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

location ~ /\.ht {
    deny all;
}

} “`

Step 4: Enable the configuration: bash sudo ln -s /etc/nginx/sites-available/pterodactyl /etc/nginx/sites-enabled/

Step 5: Test the Nginx configuration: bash sudo nginx -t

Step 6: Restart Nginx: bash sudo systemctl restart nginx

SSL Configuration with Let’s Encrypt

Step 1: Install Certbot: bash sudo apt install certbot python3-certbot-nginx -y

Step 2: Obtain a certificate: bash sudo certbot --nginx -d your_domain.com

9. Adding Game Servers

To add game servers Install Pterodactyl, you can use Docker images available on Docker Hub for popular games like Minecraft, Rust, and others.

10. Securing Your Installation

  • Regularly update your VPS and packages.
  • Use strong passwords for MySQL and your Pterodactyl user.

11. Testing Your Setup

Visit your domain in a web browser to access the Pterodactyl panel. Log in with your credentials and ensure everything is functioning correctly.

12. Troubleshooting Common Issues

  • Issue: 500 Internal Server Error
    • Solution: Check Nginx configurations and ensure the correct PHP version is installed.

13. Conclusion

Installing and configuring Pterodactyl on your VPS allows you to manage game servers efficiently. With the steps outlined in this guide, you should have a fully operational game server management panel.


14. FAQ

Q1: What games can I manage with Pterodactyl?
A: Pterodactyl supports various games such as Minecraft, CS:GO, Rust, and ARK: Survival Evolved.

Q2: Can I use Pterodactyl for free?
A: Yes, Pterodactyl is open-source and free to use.

Q3: How do I back up my Pterodactyl installation?
A: Regularly back up your database and the /var/www/pterodactyl directory.

Q4: Is a dedicated IP address required for Pterodactyl?
A: No, but having a dedicated IP can improve performance and reliability.


 

Index