How to Install Pterodactyl Panel and Wings on Ubuntu 24.04 VPS

Introduction

If you're looking to host game servers efficiently, the Pterodactyl Panel is an excellent choice. It offers a user-friendly interface and robust features for managing game servers, making it popular among gamers and server administrators alike. At ByteHosting, we understand the importance of reliable, affordable hosting, which is why we provide cost-effective VPS solutions in Frankfurt am Main. In this guide, we will walk you through the step-by-step process of installing Pterodactyl Panel on Ubuntu 24.04 VPS. Whether you're a beginner or experienced sysadmin, our instructions are designed to be clear and straightforward.

Prerequisites: Setting up Your Ubuntu 24.04 VPS

Before we begin, ensure you have a fresh Ubuntu 24.04 VPS. Our servers in Frankfurt am Main are perfect for this purpose, offering high uptime and excellent performance. You should have root or sudo access to your server to install necessary packages and configure the system.

For this tutorial, we assume you are logged in as a user with sudo privileges. If not, switch to such a user or gain root access using sudo -i.

Installing Dependencies and Docker

1. Update Your System

Start by updating your package list and upgrading existing packages:

sudo apt update && sudo apt upgrade -y

2. Install Required Dependencies

Next, install essential dependencies:

sudo apt install -y curl wget apt-transport-https ca-certificates software-properties-common

3. Install Docker

Pterodactyl Wings runs inside Docker containers, so installing Docker is crucial. We recommend installing Docker from the official Docker repository for the latest version:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list

sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io

4. Verify Docker Installation

Ensure Docker is installed correctly:

docker --version

You should see the Docker version output, confirming a successful installation.

Installing Pterodactyl Panel

1. Install Dependencies for Pterodactyl

We need to install PHP, Composer, and other required packages:

sudo apt install -y php8.2 php8.2-cli php8.2-common php8.2-mysql php8.2-zip php8.2-mbstring php8.2-curl php8.2-xml php8.2-bcmath php8.2-gd php8.2-ldap php8.2-redis unzip git nginx mariadb-server

2. Secure Your Database

Run the following to secure your MariaDB installation:

sudo mysql_secure_installation

Follow the prompts to set a root password and remove anonymous users.

3. Create a Database for Pterodactyl

Log into MySQL and create a database and user:

sudo mysql -u root -p
CREATE DATABASE pterodactyl;
CREATE USER 'ptero'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON pterodactyl.* TO 'ptero'@'localhost';
FLUSH PRIVILEGES;
EXIT;

4. Download and Install Pterodactyl Panel

Navigate to your web root and clone the panel:

cd /var/www
sudo git clone https://github.com/pterodactyl/panel.git /var/www/pterodactyl

Set permissions:

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

5. Install Composer Dependencies

Navigate to the panel directory and install dependencies:

cd /var/www/pterodactyl
sudo composer install --no-dev --optimize-autoloader

6. Set Up Environment and Database

Copy the example environment file and generate the application key:

sudo cp .env.example .env
sudo php artisan key:generate

Edit the .env file to set your database credentials:

DB_DATABASE=pterodactyl
DB_USERNAME=ptero
DB_PASSWORD=your_password

Run migrations:

sudo php artisan migrate --seed

Configuring Pterodactyl and Wings

1. Install Wings (Daemon)

Wings is the game server daemon. Download and install it:

sudo mkdir -p /etc/pterodactyl
sudo curl -L https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_amd64 -o /usr/local/bin/wings
sudo chmod +x /usr/local/bin/wings

Create the Wings configuration:

sudo nano /etc/pterodactyl/config.yml

Follow the official documentation for detailed configuration options, including setting the API key and server settings.

2. Enable and Start Wings

sudo systemctl enable wings
sudo systemctl start wings

3. Configure Nginx

Create a server block for your panel:

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

Sample configuration:

server {
    listen 80;
    server_name your_domain.com;

    root /var/www/pterodactyl/public;

    index index.php;

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

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    }

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

Enable the site and restart Nginx:

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

Testing the Installation and Accessing the Panel

Open your browser and navigate to your server's domain or IP address. You should see the Pterodactyl login page. Complete the initial setup by creating an admin account and configuring your server settings.

Troubleshooting Common Issues

  • Cannot access the panel: Check your Nginx configuration and ensure the server is running.
  • Wings not starting: Verify your configuration file and logs in /var/log/wings.log.
  • Database connection errors: Double-check your .env settings and database credentials.

Conclusion

Installing Pterodactyl Panel on Ubuntu 24.04 VPS might seem complex at first, but with careful step-by-step execution, it becomes manageable. At ByteHosting, we provide reliable VPS hosting in Frankfurt am Main, perfect for deploying game management panels like Pterodactyl. Our affordable plans ensure you have the resources needed to run your servers smoothly. Follow this guide, and you'll have a fully functional game server management panel ready to host your favorite games. If you encounter issues, our support team is here to help. Happy gaming!

Read more