This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

[Cyber Week Savings] Unleash the power of managed cloud hosting at 40% OFF for 4 months. GET THE DEAL

How to Install PHPMyAdmin on a Server?

Updated on May 21, 2021

5 Min Read
install-phpmyadmin

Database is an essential part of any web based application for saving records and user data. Previously, I’ve written about how you can setup MySQL on debian based servers. MySQL is actually a part of LAMP/LEMP stack, both of which form an integral part of PHP applications. Hence, once you install MySQL on any web hosting for PHP, you can carry out your job using MySQL commands in terminal.

Developers can perform all the above mentioned tasks easily. They can easily find and run commands on the terminal to work with MySQL queries. But sometimes, there are non-tech people too who do not want to go in technical details to perform some simple database operations. This is where PHPMyAdmin comes into play as a handy tool for them to work with pre-defined MySQL queries. The platform gives you the ease to perform complex database operations in just a few clicks and write queries with debugging.

Let’s see how you can install PHPMyAdmin on debian based cloud servers. The process is quite easy followed by some commands. I’m assuming here that you have already installed MySQL on your hosting server.

Nothing as Easy as Deploying PHP Apps on Cloud

With Cloudways, you can have your PHP apps up and running on managed cloud servers in just a few minutes.

Install PHPMyAdmin on Debian

There are not only non-techie people who want a better GUI to handle complex database functions, but developers too need such a kind of platform to save their precious time. That’s why the best platform recommended for handling database jobs is PHPMyAdmin. It’s is an open source GUI which helps in managing MySQL database. Let’s first setup an SSL with Apache, so that our password isn’t sent in plain text form. Type the following command to install an SSL with Apache server.

apt-get install mcrypt

Now, restart your Apache server with the following command.

service apache2 restart

Now, begin PHPMyAdmin installation by typing the following command.

apt-get install phpmyadmin

During PHPMyAdmin installation process, a prompt will open which will ask you about the web server you are using. Select Apache and press the Enter key. After that it will ask about the root user password. Enter the password and press Enter, once again.

PHPMyAdmin will be installed in /usr/share/phpmyadmin. We will create its symlink inside the public_html folder. Type the following commands to route to public_html folder and create a symlink:

cd /var/www/public_html

ln -s /usr/share/phpmyadmin

Now type ‘ls’ to verify whether the symlink has been created or not. Once verified, open this in browser through [server ip address]/phpmyadmin where you’ll see that it is installed. Now, let’s secure it by creating a .htaccess file using vim file inside PHPMyAdmin folder and allow only your server IP to access it.

order allow,deny

allow from <your server ip>

Now, you can easily use PHPMyAdmin and work with databases.

But, the next question is how to open PHPMyAdmin on Cloudways managed servers? To do that you need to follow some steps.

Install PHPMyAdmin on Cloudways

You can install PHPMyAdmin on the app you are using or can launch a new PHP stack application.

DO installation

Once you have launched the PHP stack application, follow the following steps in order to install PHPMyAdmin.

Improve Your PHP App Speed by 300%

Cloudways offers you dedicated servers with SSD storage, custom performance, an optimized stack, and more for 300% faster load times.

Step 1: Launch SSH Terminal

Login to Cloudways Platform, launch SSH terminal and login using Master Credentials.

master-credentials

After successful login, head to the application folder where you want to download PHPMyAdmin by using the following command.

cd applications/<folder name>/public_html

Step 2: Downloading And Installing PHPMyAdmin

Now go to the PHPMyAdmin website and copy the download URL of the latest version of PHPMyAdmin (zipped format)

phpMyAdmin-download

Now go to SSH Terminal, type the following command and paste the download URL.

wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-english.zip

Press Enter and let the server download the file.

install-phpMyAdmin

Once the file has been downloaded,  run the following command to unzip it.

unzip phpMyAdmin-5.2.0-english.zip

Wait for the command to finish its process.

unzip-phpMyAdmin

Once done, run the following command to delete the zip.

rm phpMyAdmin-5.2.0-english.zip

rename-phpMyAdmin

Let’s rename the folder so that we can access it easily by running the following command.

mv phpMyAdmin-5.2.0-english.zip phpmyadmin

remove-phpMyAdmin-zip

Note: Go here to learn more about useful SSH commands .

Now head to the application URL and add /PHPMyAdmin at the end of the URL. You will see that PHPMyAdmin has been installed and you will see its login page.

welcome-phpMyAdmin

Now login using the database credentials.

mysql-access

Once you have logged in with your database credentials, you can successfully access the PHPMyAdmin page.

phpMyAdmin-dashboard

You have successfully installed PHPMyAdmin. You can use it to access all your applications’ databases on the server on which it is installed.

Q: How to use PHPMyAdmin after installation?

A: Once phpMyAdmin installation is completed, visit your staging app link to access it. For example, http://phpstack-123.cloudwaysapps.com/phpmyadmin.

Q: How to find the port for PHPMyAdmin?

A: On the PHPMyAdmin home screen, click on Home, and move to the Variables option available on the top. Search for port settings, the values are available there.

Q: How to start/install the phpMyAdmin from the command line on Ubuntu?

A: Access the terminal window on your Ubuntu server. Issue the command sudo apt-get install phpmyadmin php-mbstring php-gettext -y. Type in your sudo password when prompted, and then allow the installation to complete.

Q: How to start phpMyAdmin on a Linux-based System?

A: To start the phpMyAdmin, type in the URL: http://{your-ip-address}/phpmyadmin/index.php and login using the MySQL root/admin username and password.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Customer Review at

“Cloudways hosting has one of the best customer service and hosting speed”

Sanjit C [Website Developer]

Ahmed Khan

Ahmed was a PHP community expert at Cloudways - A Managed PHP Hosting Cloud Platform. He is a software engineer with extensive knowledge in PHP and SEO. He loves watching Game of Thrones is his free time. Follow Ahmed on Twitter to stay updated with his works. You can email him at [email protected]

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Unleash The Cloud.
Not Budgets.

For 4 Months +
Up To 30 Free Migrations

Cyber Week

SAVINGS
Time Left In Offer
  • 0

    Days

  • 0

    Hours

  • 0

    Minutes

  • 0

    Seconds

40% OFF

On All Plans

GET THE DEAL NOW