When it comes to managing MySQL or MariaDB databases, phpMyAdmin is one of the most powerful and user-friendly tools available. It provides a browser-based interface that simplifies database tasks like running queries, managing users, and creating tables. However, installing phpMyAdmin on a fresh server can sometimes lead to configuration errors, especially for new users. In this article, we’ll guide you on how to install phpMyAdmin on Ubuntu 24.04 without errors, ensuring a smooth, functional, and secure setup using the latest Vultr guide.
Why Choose phpMyAdmin?
phpMyAdmin is a PHP-based web application that makes MySQL/MariaDB database management easy and accessible. Instead of working through a command-line interface, phpMyAdmin gives you a visual dashboard to:
- Create and manage databases
- Run SQL queries
- Backup and export data
- Manage user permissions
It’s widely supported, highly customizable, and ideal for both beginners and experienced developers.
Step 1: Prepare Your Ubuntu 24.04 Server
Before you install phpMyAdmin, make sure your server is ready with the LAMP stack (Linux, Apache, MySQL/MariaDB, PHP):
sudo apt update
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql
Once installed, start and enable the necessary services:
sudo systemctl enable apache2 --now
sudo systemctl enable mysql --now
It’s always a good idea to update your system:
sudo apt upgrade
This ensures your packages are current and reduces the chance of compatibility errors during installation.
Step 2: Install phpMyAdmin on Ubuntu 24.04
Now let’s install phpMyAdmin using the APT package manager:
sudo apt install phpmyadmin
During installation, you will be prompted to:
- Select a web server: Choose Apache2 by pressing spacebar, then Enter.
- Configure database for phpMyAdmin with dbconfig-common: Select Yes.
- Enter and confirm a phpMyAdmin password: Choose a secure password for the database user.
⚠️ Common Error: Skipping Apache selection will result in phpMyAdmin not being configured correctly with your web server. If this happens, continue to Step 3 to fix it.
Step 3: Manually Configure Apache for phpMyAdmin
If phpMyAdmin isn't accessible after installation, it may not be linked to Apache. Fix it with:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin
sudo systemctl reload apache2
Now you should be able to access phpMyAdmin via:
http://your_server_ip/phpmyadmin
Log in using your MySQL credentials.
Step 4: Install Required PHP Extensions
phpMyAdmin requires several PHP modules for full functionality. Install them using:
sudo apt install php-mbstring php-zip php-gd php-json php-curl
sudo systemctl restart apache2
Failing to install these can result in missing features or visual errors in the UI.
Step 5: Secure Your phpMyAdmin Installation
Out-of-the-box phpMyAdmin is publicly accessible, which can be a security risk. Secure it with these simple measures:
Change URL Access Path
Rename the default path to something obscure:
sudo mv /usr/share/phpmyadmin /usr/share/mycustompanel
- Update your Apache configuration accordingly.
Add HTTP Authentication
Create a password layer using Apache:
sudo apt install apache2-utils
sudo htpasswd -c /etc/phpmyadmin/.htpasswd adminuser
Edit your Apache config to include:
Directory /usr/share/phpmyadmin
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /etc/phpmyadmin/.htpasswd
Require valid-user
/Directory
Enable HTTPS
Use Let’s Encrypt for SSL encryption:
sudo apt install certbot python3-certbot-apache
sudo certbot --apache
Step 6: Troubleshooting Common Issues
- Blank Login Page: Check if all required PHP extensions are installed.
- 403 Forbidden Error: Make sure Apache has read access to the phpMyAdmin directory.
- Login Fails: Verify MySQL user credentials and ensure MySQL is running.
Conclusion
With careful setup, you can install phpMyAdmin on Ubuntu 24.04 without errors, ensuring that your server is stable, secure, and ready for efficient database management. By following these steps and referencing the reliable Vultr documentation, you avoid common pitfalls and enjoy a smooth phpMyAdmin experience.
This easy-to-follow approach ensures a reliable setup process, making phpMyAdmin a must-have tool for any Ubuntu-based web server in 2025.