Skip to content

Commit 430e2c2

Browse files
authored
Pterodactyl Panel (#2801)
* New Script: Pterodactyl Panel * Add sources and replace tag * Update pterodactyl-panel-install.sh * Update pterodactyl-panel-install.sh * Update pterodactyl-panel-install.sh
1 parent e623eb4 commit 430e2c2

File tree

3 files changed

+257
-0
lines changed

3 files changed

+257
-0
lines changed

ct/pterodactyl-panel.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: bvdberg01
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/pterodactyl/panel
7+
8+
APP="Pterodactyl-Panel"
9+
var_tags="gaming"
10+
var_cpu="2"
11+
var_ram="1024"
12+
var_disk="4"
13+
var_os="debian"
14+
var_version="12"
15+
var_unprivileged="1"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -d /opt/pterodactyl-panel ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
RELEASE=$(curl -s https://api.github.com/repos/pterodactyl/panel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
31+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
32+
msg_info "Stopping Service"
33+
cd /opt/pterodactyl-panel
34+
$STD php artisan down
35+
msg_ok "Stopped Service"
36+
37+
msg_info "Updating ${APP} to v${RELEASE}"
38+
cp -r /opt/pterodactyl-panel/.env /opt/
39+
rm -rf * .*
40+
wget -q "https://github.com/pterodactyl/panel/releases/download/v${RELEASE}/panel.tar.gz"
41+
tar -xzf "panel.tar.gz"
42+
mv /opt/.env /opt/pterodactyl-panel/
43+
$STD composer install --no-dev --optimize-autoloader --no-interaction
44+
$STD php artisan view:clear
45+
$STD php artisan config:clear
46+
$STD php artisan migrate --seed --force --no-interaction
47+
chown -R www-data:www-data /opt/pterodactyl-panel/*
48+
chmod -R 755 /opt/pterodactyl-panel/storage /opt/pterodactyl-panel/bootstrap/cache/
49+
echo "${RELEASE}" >/opt/${APP}_version.txt
50+
msg_ok "Updated $APP to v${RELEASE}"
51+
52+
msg_info "Starting Service"
53+
$STD php artisan queue:restart
54+
$STD php artisan up
55+
msg_ok "Started Service"
56+
57+
msg_info "Cleaning up"
58+
rm -rf "/opt/pterodactyl-panel/panel.tar.gz"
59+
msg_ok "Cleaned"
60+
msg_ok "Updated Successfully"
61+
else
62+
msg_ok "No update required. ${APP} is already at v${RELEASE}"
63+
fi
64+
exit
65+
}
66+
67+
start
68+
build_container
69+
description
70+
71+
msg_ok "Completed Successfully!\n"
72+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
73+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
74+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: bvdberg01
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/pterodactyl/panel
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
lsb-release \
22+
redis \
23+
mariadb-server \
24+
mariadb-client \
25+
apache2 \
26+
composer
27+
msg_ok "Installed Dependencies"
28+
29+
msg_info "Adding PHP8.3 Repository"
30+
$STD curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
31+
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
32+
$STD sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
33+
$STD apt-get update
34+
msg_ok "Added PHP8.3 Repository"
35+
36+
msg_info "Installing PHP"
37+
$STD apt-get remove -y php8.2*
38+
$STD apt-get install -y \
39+
php8.3 \
40+
php8.3-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm} \
41+
libapache2-mod-php8.3
42+
msg_ok "Installed PHP"
43+
44+
msg_info "Setting up MariaDB"
45+
DB_NAME=panel
46+
DB_USER=pterodactyl
47+
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
48+
$STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
49+
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
50+
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
51+
{
52+
echo "pterodactyl Panel-Credentials"
53+
echo "pterodactyl Panel Database User: $DB_USER"
54+
echo "pterodactyl Panel Database Password: $DB_PASS"
55+
echo "pterodactyl Panel Database Name: $DB_NAME"
56+
} >> ~/pterodactyl-panel.creds
57+
msg_ok "Set up MariaDB"
58+
59+
read -p "Provide an email address for admin login, this should be a valid email address: " ADMIN_EMAIL
60+
read -p "Enter your First Name: " NAME_FIRST
61+
read -p "Enter your Last Name: " NAME_LAST
62+
63+
msg_info "Installing pterodactyl Panel"
64+
RELEASE=$(curl -s https://api.github.com/repos/pterodactyl/panel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
65+
mkdir /opt/pterodactyl-panel
66+
cd /opt/pterodactyl-panel
67+
wget -q "https://github.com/pterodactyl/panel/releases/download/v${RELEASE}/panel.tar.gz"
68+
tar -xzf "panel.tar.gz"
69+
cp .env.example .env
70+
IP=$(hostname -I | awk '{print $1}')
71+
ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
72+
$STD composer install --no-dev --optimize-autoloader --no-interaction
73+
$STD php artisan key:generate --force
74+
$STD php artisan p:environment:setup --no-interaction --author $ADMIN_EMAIL --url "http://$IP"
75+
$STD php artisan p:environment:database --no-interaction --database $DB_NAME --username $DB_USER --password $DB_PASS
76+
$STD php artisan migrate --seed --force --no-interaction
77+
$STD php artisan p:user:make --no-interaction --admin=1 --email "$ADMIN_EMAIL" --password "$ADMIN_PASS" --name-first "$NAME_FIRST" --name-last "$NAME_LAST" --username "admin"
78+
echo "* * * * * php /opt/pterodactyl-panel/artisan schedule:run >> /dev/null 2>&1" | crontab -u www-data -
79+
chown -R www-data:www-data /opt/pterodactyl-panel/*
80+
chmod -R 755 /opt/pterodactyl-panel/storage/* /opt/pterodactyl-panel/bootstrap/cache/
81+
{
82+
echo ""
83+
echo "pterodactyl Admin Username: admin"
84+
echo "pterodactyl Admin Email: $ADMIN_EMAIL"
85+
echo "pterodactyl Admin Password: $ADMIN_PASS"
86+
} >> ~/pterodactyl-panel.creds
87+
88+
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
89+
msg_ok "Installed pterodactyl Panel"
90+
91+
msg_info "Creating Service"
92+
cat <<EOF >/etc/systemd/system/pteroq.service
93+
[Unit]
94+
Description=Pterodactyl Queue Worker
95+
After=redis-server.service
96+
97+
[Service]
98+
User=www-data
99+
Group=www-data
100+
Restart=always
101+
ExecStart=/usr/bin/php /opt/pterodactyl-panel/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
102+
StartLimitInterval=180
103+
StartLimitBurst=30
104+
RestartSec=5s
105+
106+
[Install]
107+
WantedBy=multi-user.target
108+
EOF
109+
systemctl enable -q --now pteroq
110+
cat <<EOF >/etc/apache2/sites-available/pterodactyl.conf
111+
<VirtualHost *:80>
112+
ServerName pterodactyl
113+
DocumentRoot /opt/pterodactyl-panel/public
114+
115+
AllowEncodedSlashes On
116+
117+
php_value upload_max_filesize 100M
118+
php_value post_max_size 100M
119+
120+
<Directory /opt/pterodactyl-panel/public>
121+
Options Indexes FollowSymLinks
122+
AllowOverride All
123+
Require all granted
124+
</Directory>
125+
126+
ErrorLog /var/log/apache2/pterodactyl_error.log
127+
CustomLog /var/log/apache2/pterodactyl_access.log combined
128+
</VirtualHost>
129+
EOF
130+
$STD a2ensite pterodactyl
131+
$STD a2enmod rewrite
132+
$STD a2dissite 000-default.conf
133+
$STD systemctl reload apache2
134+
msg_ok "Created Service"
135+
136+
motd_ssh
137+
customize
138+
139+
msg_info "Cleaning up"
140+
rm -rf "/opt/pterodactyl-panel/panel.tar.gz"
141+
rm -rf "/tmp/debsuryorg-archive-keyring.deb"
142+
$STD apt-get -y autoremove
143+
$STD apt-get -y autoclean
144+
msg_ok "Cleaned"

json/pterodactyl-panel.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "Pterodactyl Panel",
3+
"slug": "pterodactyl-panel",
4+
"categories": [
5+
24
6+
],
7+
"date_created": "2025-03-03",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 80,
12+
"documentation": "https://pterodactyl.io/panel/1.0/getting_started.html",
13+
"website": "https://pterodactyl.io",
14+
"logo": "https://pterodactyl.io/logos/pterry.svg",
15+
"description": "Pterodactyl Panel is a web-based control panel for managing game and application servers. It provides an intuitive interface to start, stop, configure, and monitor servers easily. It works alongside Pterodactyl Wings, a lightweight daemon that handles server deployments and resource management.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/pterodactyl-panel.sh",
20+
"resources": {
21+
"cpu": 2,
22+
"ram": 1024,
23+
"hdd": 4,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "Show login and database credentials: `cat ~/pterodactyl-panel.creds`",
36+
"type": "info"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)