The Best Way To Install PHPMyAdmin On A Server

Rifat WordPress Tutorials Dec 28, 2022

A database is an important part of any web-based application because it stores records and information about users. I've written before about how to set up MySQL on servers that run Debian. MySQL is a part of the LAMP/LEMP stack, which are both important parts of PHP applications. So, once you install MySQL on any PHP web host, you can use MySQL commands in the terminal to do your work.

All of the above tasks are easy for developers to do. They can quickly find and run the commands they need to work with MySQL queries at the terminal. But sometimes, non-technical people don't want to get into technical details to do simple database tasks. PHPMyAdmin is a useful tool that lets them work with pre-defined MySQL queries. The platform makes it easy to do complicated database tasks with just a few clicks and to write queries that can be tested.

Let's look at how to set up PHPMyAdmin on cloud servers that run Debian. The process is pretty easy, and then you have to give some commands. I'm going to assume that you already have MySQL set up on your hosting server.

Debian PHPMyAdmin installation

Not only do non-technical users demand a better GUI to manage complex database functions, but developers also want such a platform to save valuable time. Because of this, PHPMyAdmin is the best platform for taking care of database jobs. It is an open-source graphical user interface that helps manage MySQL databases. Let's first set up an SSL with Apache so that our password isn't sent in plain text. To add an SSL to an Apache server, type the following command.

Elementor Black Friday

Enjoy Amazing Deals Up to 50% Off

Start Now
apt-get install mcrypt

Now, use the following command to tell Apache to start up again.

service apache2 restart

Now, type the following command to start setting up PHPMyAdmin.

apt-get install phpmyadmin

During the installation of PHPMyAdmin, a window will pop up and ask you what web server you are using. Choose Apache, then press Enter. After that, it will ask for the password of the root user. Type in the password again and press Enter.

PHPMyAdmin will be put in the /usr/share/phpmyadmin folder. We'll make a link to it inside the public html folder. Type the following commands to create a symlink and route it to the public html folder:

cd /var/www/public_html
ln -s /usr/share/phpmyadmin

Now type "ls" to see if the symlink has been made. Once it's been checked, open it in your browser at [server IP address]/phpmyadmin to see that it's been set up. Now, let's lock it down by making a.htaccess file in the PHPMyAdmin folder using vim and letting only your server's IP address access it.

order allow,deny
allow from <your server ip>

Now, it's easy to work with databases and PHPMyAdmin.

But the next question is how to open PHPMyAdmin on servers that are managed by Cloudways. To do that, you have to do a few things.

Cloudways PHPMyAdmin installation

You can add PHPMyAdmin to the app you are already using or start a new PHP stack app.

DO installation

In order to install PHPMyAdmin, you must first launch the PHP stack application.

Launch SSH Terminal

Connect to the Cloudways Platform via an SSH terminal and enter your Master Credentials to log in.


After you have logged in, use the following command to access to the directory where you installed applications and then download PHPMyAdmin.

cd applications/<folder name>/public_html

Downloading And Installing PHPMyAdmin

Go ahead and visit PHPMyAdmin's official website now to grab the most recent version's download link (zipped format)


Next, copy the download URL and enter it alongside the following command in the SSH Terminal.


Hit the enter key to start the download from the server.


After downloading the file, use the following command to extract its contents.


Just hold on until the command completes.


When you're finished, type the following command to get rid of the zip.


Use this command to rename the folder for easier access.

mv phpmyadmin

Visit the application's URL and append /PHPMyAdmin to it. After installing PHPMyAdmin, you'll be able to access its interface and manage your database.


Using the database's login credentials, you can now enter the system.


It is possible to view the PHPMyAdmin interface after successfully logging in with the database credentials.


Wrapping Up

Congratulations, PHPMyAdmin has been successfully installed. When it is set up on a server, you can use it to connect to the databases of any program using that server.

Divi WordPress Theme