Install phpMyAdmin for Pterodactyl
Easily manage your MySQL databases with phpMyAdmin directly from your Pterodactyl server.
π Prerequisites
β A server with Pterodactyl Panel installed β MySQL/MariaDB configured and functional β Nginx or Apache installed β Root or sudo access to the server β A domain name or subdomain (recommended)
Install phpMyAdmin
On Ubuntu / Debian
# Update packages
sudo apt update
# Install phpMyAdmin
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl -y
π‘ Tip: During installation, select "apache2" with the spacebar even if you're using Nginx (we'll configure Nginx manually).
During installation:
- Select web server: apache2 (press space then Enter)
- Configure database: Yes
- Set a password for phpMyAdmin
On CentOS / Rocky Linux
# Install EPEL repository
sudo yum install epel-release -y
# Install phpMyAdmin
sudo yum install phpmyadmin -y
Configure phpMyAdmin
Enable Required PHP Extensions
# Enable mbstring
sudo phpenmod mbstring
# Restart PHP-FPM
sudo systemctl restart php8.1-fpm
π‘ Note: Replace php8.1-fpm with your PHP version (php7.4-fpm, php8.2-fpm, etc.).
Create a Symbolic Link
# Create a link to Pterodactyl's web directory
sudo ln -s /usr/share/phpmyadmin /var/www/pterodactyl/public/phpmyadmin
# Create a dedicated folder
sudo mkdir -p /var/www/phpmyadmin
sudo cp -r /usr/share/phpmyadmin/* /var/www/phpmyadmin/
sudo chown -R www-data:www-data /var/www/phpmyadmin
Configure Nginx
Create an Nginx configuration for phpMyAdmin.
sudo nano /etc/nginx/sites-available/phpmyadmin
server {
listen 80;
server_name phpmyadmin.yourdomain.com;
root /var/www/phpmyadmin;
index index.php index.html;
# Logs
access_log /var/log/nginx/phpmyadmin-access.log;
error_log /var/log/nginx/phpmyadmin-error.log;
# Security - Block access to sensitive files
location ~ ^/(libraries|setup/frames|setup/libs) {
deny all;
return 404;
}
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Block access to hidden files
location ~ /\. {
deny all;
}
}
β οΈ Important
Replace phpmyadmin.yourdomain.com with your own domain and php8.1-fpm.sock with your PHP version.
# Create symbolic link
sudo ln -s /etc/nginx/sites-available/phpmyadmin /etc/nginx/sites-enabled/
# Test Nginx configuration
sudo nginx -t
# Restart Nginx
sudo systemctl restart nginx
Secure phpMyAdmin with SSL
Use Certbot to get a free SSL certificate.
# Install Certbot
sudo apt install certbot python3-certbot-nginx -y
# Obtain SSL certificate
sudo certbot --nginx -d phpmyadmin.yourdomain.com
β Certbot will automatically configure Nginx to use HTTPS and redirect HTTP to HTTPS.
Create a Dedicated MySQL User
For better security, create a specific MySQL user for phpMyAdmin.
# Connect to MySQL
sudo mysql -u root -p
-- Create a user with all privileges
CREATE USER 'phpmyadmin_user'@'localhost' IDENTIFIED BY 'strong_password';
-- Grant all privileges
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin_user'@'localhost' WITH GRANT OPTION;
-- Apply changes
FLUSH PRIVILEGES;
-- Exit
EXIT;
π‘ Tip: Replace strong_password with a complex and unique password.
Strengthen Security
Configure HTTP Authentication
Add an extra layer of security with HTTP authentication.
# Install apache2-utils
sudo apt install apache2-utils -y
# Create a password file
sudo htpasswd -c /etc/nginx/.htpasswd admin_user
sudo nano /etc/nginx/sites-available/phpmyadmin
location / {
auth_basic "Restricted Area";
auth_basic_user_file /etc/nginx/.htpasswd;
try_files $uri $uri/ =404;
}
sudo systemctl restart nginx
Change Access URL
Modify the default URL for better security.
sudo nano /etc/nginx/sites-available/phpmyadmin
location /my-secret-panel {
auth_basic "Restricted Area";
auth_basic_user_file /etc/nginx/.htpasswd;
alias /var/www/phpmyadmin;
index index.php;
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}
Restrict Access by IP
Limit phpMyAdmin access to specific IP addresses.
location /phpmyadmin {
# Only allow these IPs
allow 123.456.789.0;
allow 192.168.1.0/24;
deny all;
auth_basic "Restricted Area";
auth_basic_user_file /etc/nginx/.htpasswd;
try_files $uri $uri/ =404;
}
Advanced phpMyAdmin Configuration
Edit the configuration file to optimize phpMyAdmin.
sudo nano /etc/phpmyadmin/config.inc.php
// Increase session timeout
$cfg['LoginCookieValidity'] = 3600;
// Force HTTPS
$cfg['ForceSSL'] = true;
// Hide system databases
$cfg['Servers'][$i]['hide_db'] = '^(information_schema|performance_schema|mysql|sys)$';
// Limit number of displayed rows
$cfg['MaxRows'] = 50;
// Enable compression mode
$cfg['ZipDump'] = true;
$cfg['GZipDump'] = true;
Verification and Testing
Test your phpMyAdmin installation.
Verification Checklist:
| Item | Status |
|---|---|
| phpMyAdmin accessible via HTTPS | β |
| HTTP authentication works | β |
| MySQL connection successful | β |
| Valid SSL certificate | β |
| Pterodactyl databases visible | β |
https://phpmyadmin.yourdomain.com
Login with:
- Username:
phpmyadmin_user(or your MySQL user) - Password: the one you set
Troubleshooting
# Check permissions
sudo chown -R www-data:www-data /var/www/phpmyadmin
sudo chmod -R 755 /var/www/phpmyadmin
# Check if PHP-FPM is running
sudo systemctl status php8.1-fpm
# Restart if necessary
sudo systemctl restart php8.1-fpm
# Check if MySQL is running
sudo systemctl status mysql
# Test connection
mysql -u phpmyadmin_user -p
π¬ Need Help?
If you encounter difficulties:
π Congratulations!
phpMyAdmin is now installed and secured on your Pterodactyl server. You can easily and securely manage your databases!

