This script automates the installation of phpMyAdmin into the public folder of a Pterodactyl panel, typically used for accessing and managing your MySQL databases via a web interface.
- Downloads the specified version of phpMyAdmin.
- Installs required packages (
unzip). - Extracts phpMyAdmin into the Pterodactyl
public/phpmyadmindirectory. - Sets correct file permissions for the web server (
www-data). - Configures
config.inc.phpwith:- A generated Blowfish secret.
- A temporary directory setting.
- Checks if the MySQL root user has a password set:
- If not, sets one using
mysql_native_password.
- If not, sets one using
- Cleans up temporary files.
phpMyAdmin will be installed in:
/var/www/pterodactyl/public/phpmyadmin
You can access it from your browser at:
https://your-domain.com/phpmyadmin
- Ubuntu or Debian-based system
- sudo privileges
- MySQL or MariaDB installed
- Pterodactyl panel already installed under
/var/www/pterodactyl
The script will check whether the MySQL root password is empty. If it is, it will set a new password using the following SQL:
ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('YourSecurePasswordHere');
FLUSH PRIVILEGES;You can change the value of MYSQL_ROOT_PASSWORD at the top of the script.
- Open a terminal on your server.
- Save the script to a file, for example:
nano install_phpmyadmin.sh- Paste the script contents into the file.
- Make it executable:
chmod +x install_phpmyadmin.sh- Run the script:
./install_phpmyadmin.sh- Once complete, navigate to
https://your-domain.com/phpmyadminin your browser.
If needed, adjust your web server configuration (Nginx/Apache) to allow access to /phpmyadmin under the public directory.
- Do not expose the phpMyAdmin panel to the public internet without proper access controls.
- Use strong MySQL root passwords and secure your database with firewalls and fail2ban where applicable.
- The script does not set up SSL – it assumes SSL is already handled by your Pterodactyl panel.
Author: nycon
License: MIT