#!/bin/bash set -e RED='\033[0;31m' YELLOW='\033[1;33m' GREEN='\033[0;32m' LIGHT_BLUE='\033[1;34m' NC='\033[0m' prompt() { local PROMPT_MESSAGE=$1 local DEFAULT_VALUE=$2 read -p "$PROMPT_MESSAGE [$DEFAULT_VALUE]: " INPUT echo "${INPUT:-$DEFAULT_VALUE}" } confirm_clean_install() { echo -e ${LIGHT_BLUE}"=================================================================${NC}" echo -e ${LIGHT_BLUE}" Pterodactyl Panel Installer v1.2.0 for Debian 12 by VS-Shop${NC}" echo -e ${LIGHT_BLUE}"=================================================================${NC}" echo -e "${YELLOW}This script is built for a clean installation of Debian 12 (Bookworm).${NC}" echo -e "${YELLOW}Please confirm your system matches this requirement.${NC}" echo -e ${LIGHT_BLUE}"=================================================================${NC}" while true; do read -p "Is this a clean installation of Debian 12? (Y/N): " response case $response in [Yy]* ) break;; [Nn]* ) echo -e "${RED}Please reinstall Debian 12 and run the script again.${NC}"; exit;; * ) echo -e "${RED}Please answer with 'Y' (Yes) or 'N' (No).${NC}";; esac done } confirm_clean_install DOMAIN=$(prompt "Enter the domain name you want to use for the Pterodactyl panel (e.g., panel.example.com)" "panel.example.com") ADMIN_EMAIL=$(prompt "Enter an email address for Certbot to use (for urgent renewal notices and security advisories)" "admin@example.com") echo -e "${GREEN}Updating system and installing base dependencies...${NC}" apt update apt -y install curl gnupg apt-transport-https ca-certificates lsb-release software-properties-common sudo unzip git tar cron echo -e "${GREEN}Installing PHP 8.3 and required extensions...${NC}" echo "deb https://packages.sury.org/php/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/sury-php.list curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-php.gpg apt update apt -y install php8.3 php8.3-{cli,common,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip} echo -e "${GREEN}Installing MariaDB, NGINX, Redis...${NC}" apt -y install mariadb-server nginx redis-server echo -e "${GREEN}Installing Composer...${NC}" curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer echo -e "${GREEN}Creating Pterodactyl installation directory...${NC}" mkdir -p /var/www/pterodactyl cd /var/www/pterodactyl echo -e "${GREEN}Downloading Pterodactyl panel...${NC}" curl -Lo panel.tar.gz https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz tar -xzvf panel.tar.gz chmod -R 755 storage/* bootstrap/cache/ echo -e "${GREEN}Setting up the MySQL database for Pterodactyl...${NC}" DB_USER=$(prompt "Enter the MySQL user for Pterodactyl" "pterodactyl") DB_PASSWORD=$(prompt "Enter the MySQL password for $DB_USER" "yourPassword") DB_NAME=$(prompt "Enter the database name for Pterodactyl" "panel") mysql -u root <> /dev/null 2>&1") | crontab - echo -e "${GREEN}Creating systemd service for queue worker...${NC}" cat < /etc/nginx/sites-available/pterodactyl.conf <