PhpMyAdmin is a free, open-source tool that provides a web-based interface to manage MySQL databases. In this guide, we will walk you through how to install PhpMyAdmin on Ubuntu 22.04 and secure it with a free Let's Encrypt SSL certificate.
Step 1: Update Your System
Start by updating your system's package list to ensure you have the latest updates:
sudo apt update && sudo apt upgrade
Step 2: Install Apache Web Server and MySQL
If you haven't already installed Apache and MySQL, you can do so by running the following commands:
sudo apt install apache2 mysql-server
Once installed, start and enable Apache and MySQL to run at boot:
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mysql
sudo systemctl enable mysql
Step 3: Install PHP
PhpMyAdmin requires PHP to run. Install PHP and the necessary extensions with the following command:
sudo apt install php libapache2-mod-php php-mysql
Step 4: Install PhpMyAdmin
Now you can install PhpMyAdmin using the following command:
sudo apt install phpmyadmin
During the installation, you will be prompted to choose the web server for PhpMyAdmin. Select Apache, and when prompted, choose to configure the database automatically using dbconfig-common.
Step 5: Configure Apache for PhpMyAdmin
Once PhpMyAdmin is installed, you need to enable the PhpMyAdmin configuration for Apache:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo systemctl reload apache2
Step 6: Secure PhpMyAdmin with Let's Encrypt SSL
To secure your PhpMyAdmin installation with SSL, you'll need to install Certbot, a tool that automates the process of obtaining SSL certificates from Let's Encrypt. Install Certbot with the following command:
sudo apt install certbot python3-certbot-apache
Run Certbot to obtain and install an SSL certificate for your domain:
sudo certbot --apache -d your_domain.com
Follow the on-screen instructions to complete the SSL setup. Certbot will automatically configure Apache to use the SSL certificate.
Step 7: Access PhpMyAdmin
Once the installation is complete, you can access PhpMyAdmin by visiting https://your_domain.com/phpmyadmin
. You should now see the PhpMyAdmin login page secured with SSL.
Conclusion
You have successfully installed PhpMyAdmin on Ubuntu 22.04 and secured it with a free Let's Encrypt SSL certificate. This setup provides a secure and easy-to-use web interface for managing your MySQL databases.
If you're looking for a reliable VPS hosting solution for your PhpMyAdmin setup, consider using Windows VPS UK. With Windows VPS, you can enjoy high-performance hosting with the flexibility to manage your web applications and databases. Whether you need VPS UK Windows or Windows Virtual Private Servers, this hosting provider offers scalable solutions to fit your needs.
For larger-scale projects, you might want to explore Windows Virtual Dedicated Server Hosting or Virtual Private Server Hosting Windows. Whether you're located in the UK, Italy, or elsewhere, Windows VPS Italy and UK VPS Windows provide secure and efficient hosting solutions. Visit Windows VPS Hosting UK to discover the best hosting options for your PhpMyAdmin setup.