PROMO20% OFF with code QY3UJAEZ59 - Limited time offer!
Tutorials

Install phpMyAdmin for Pterodactyl

Complete guide to install and configure phpMyAdmin on your Pterodactyl panel. Easily manage your MySQL databases.

πŸ“–6 min read
⚑Intermediate
πŸ“…1/13/2025
πŸ”„Updated 1/14/2026

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)


1

Install phpMyAdmin

On Ubuntu / Debian

β–Έ Install packages
# 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:

  1. Select web server: apache2 (press space then Enter)
  2. Configure database: Yes
  3. 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

2

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

β–Έ Option 1: Link to Pterodactyl
# Create a link to Pterodactyl's web directory
sudo ln -s /usr/share/phpmyadmin /var/www/pterodactyl/public/phpmyadmin
β–Έ Option 2: Separate directory (recommended)
# 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

3

Configure Nginx

Create an Nginx configuration for phpMyAdmin.

β–Έ Create configuration file
sudo nano /etc/nginx/sites-available/phpmyadmin
β–Έ Recommended configuration
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.

β–Έ Enable configuration
# 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

4

Secure phpMyAdmin with SSL

Use Certbot to get a free SSL certificate.

β–Έ Install Certbot
# 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.


5

Create a Dedicated MySQL User

For better security, create a specific MySQL user for phpMyAdmin.

β–Έ Connect to MySQL
# Connect to MySQL
sudo mysql -u root -p
β–Έ Create user in MySQL
-- 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.


6

Strengthen Security

Configure HTTP Authentication

Add an extra layer of security with HTTP authentication.

β–Έ Create password file
# Install apache2-utils
sudo apt install apache2-utils -y

# Create a password file
sudo htpasswd -c /etc/nginx/.htpasswd admin_user
β–Έ Modify Nginx configuration
sudo nano /etc/nginx/sites-available/phpmyadmin
β–Έ Add authentication
location / {
    auth_basic "Restricted Area";
    auth_basic_user_file /etc/nginx/.htpasswd;
    try_files $uri $uri/ =404;
}
β–Έ Restart Nginx
sudo systemctl restart nginx

Change Access URL

Modify the default URL for better security.

β–Έ Modify configuration
sudo nano /etc/nginx/sites-available/phpmyadmin
β–Έ Change the access path
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;
}

7

Advanced phpMyAdmin Configuration

Edit the configuration file to optimize phpMyAdmin.

β–Έ Edit configuration
sudo nano /etc/phpmyadmin/config.inc.php
β–Έ Recommended settings
// 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;

8

Verification and Testing

Test your phpMyAdmin installation.

Verification Checklist:

ItemStatus
phpMyAdmin accessible via HTTPSβœ…
HTTP authentication worksβœ…
MySQL connection successfulβœ…
Valid SSL certificateβœ…
Pterodactyl databases visibleβœ…
β–Έ Access phpMyAdmin
https://phpmyadmin.yourdomain.com

Login with:

  • Username: phpmyadmin_user (or your MySQL user)
  • Password: the one you set

Troubleshooting

β–Έ 403 Forbidden Error
# Check permissions
sudo chown -R www-data:www-data /var/www/phpmyadmin
sudo chmod -R 755 /var/www/phpmyadmin
β–Έ PHP-FPM Error
# Check if PHP-FPM is running
sudo systemctl status php8.1-fpm

# Restart if necessary
sudo systemctl restart php8.1-fpm
β–Έ MySQL Connection Error
# 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!

Tags

#pterodactyl#phpmyadmin#mysql#database#panel
Questions? Let’s chat.
contact [at] atmosnode [dot] com
Live Chat
AtmosNode
Β© 2025 AtmosNode.com β€’ Company number: 899 139 182
Loading...
Company not subject to VAT

πŸ”’ Secure Payment Methods (Crypto accepted)

Visa
MasterCard
PayPal
Apple Pay
Google Pay