• Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How To Install phpMyAdmin on Ubuntu 20.04

Written by Rahul, Updated on October 15, 2020

phpMyadmin is the best web based client for accessing MySQL servers. It is freely available to download and install on your server. You can host this on any server running with Apache and PHP.

The phpMyAdmin is written on PHP. The current phpMyAdmin version is compatible with PHP 7.1 and newer and MySQL 5.5 or MariaDB 5.5 or newer.

This tutorial will help you to install and configure phpMyAdmin on Ubuntu 20.04 Linux system.

Step 1 – Install Apache and PHP

We are assuming you already have installed the MySQL server on Ubuntu system. So just install the other required packages to run and access phpMyAdmin.

sudo apt install apache2 wget unzip
sudo apt install php php-zip php-json php-mbstring php-mysql

Once the installation finished, enable and start Apache web server.

systemctl enable apache2
systemctl start apache2

Step 2 – Install phpMyAdmin on Ubuntu 20.04

phpMyAdmin is also available under the default packages repository but mostly they have older version. In this tutorial, we will download latest phpMyAdmin and configure on our system.

Your system is ready for the phpMyAdmin installation. Download the latest phpMyAdmin archive from the official download page, or use the below commands to download phpMyAdmin 5.0.3 on your system.

After downloading extract archive and move to the proper location.

wget https://files.phpmyadmin.net/phpMyAdmin/5.0.3/phpMyAdmin-5.0.3-all-languages.zip
unzip phpMyAdmin-5.0.3-all-languages.zip
mv phpMyAdmin-5.0.3-all-languages /usr/share/phpmyadmin

Next, create tmp directory and set the proper permissions.

mkdir /usr/share/phpmyadmin/tmp
chown -R www-data:www-data /usr/share/phpmyadmin
chmod 777 /usr/share/phpmyadmin/tmp

Step 3 – Configure phpMyAdmin

Now, you need to configure web server to serve phpMyAdmin on network. Create Apache configuration file for phpMyAdmin and edit in text editor:

sudo vi /etc/apache/conf-available/phpmyadmin.conf

add the below content to file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
 
<Directory /usr/share/phpmyadmin/>
   AddDefaultCharset UTF-8
   <IfModule mod_authz_core.c>
      <RequireAny>
      Require all granted
     </RequireAny>
   </IfModule>
</Directory>
 
<Directory /usr/share/phpmyadmin/setup/>
   <IfModule mod_authz_core.c>
     <RequireAny>
       Require all granted
     </RequireAny>
   </IfModule>
</Directory>

Save your file. Press ESC key to switch to command more. Then type : (colon) and type w after the colon and hit Enter.

After making all the changes, make sure to start the Apache service to reload all settings.

sudo a2enconf phpmyadmin
sudo systemctl restart apache2

Step 4 – Adjusting FirewallD

The systems with enabled firewalls need to allow HTTP service from the firewall. Run the below commands to open a port for the webserver in the firewall.

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload

Step 5 – Access phpMyAdmin

All done. You have finished the setup with the phpMyAdmin on Ubuntu Linux system. Now access phpMyAdmin with the server IP address or domain name.

http://your-server-ip-domain/phpmyadmin

Replace your-server-ip-domain with the localhost (for the local machines), or system IP address for remote machines. I have updated our DNS and pointed dbhost.tecadmin.net to the server’s IP address.

how to install phpmyadmin on ubuntu 20.04

Log in with the username and password used to access MySQL on the command line.

setup phpmyadmin ubuntu 20.04

Conclusion

You have successfully configured phpMyAdmin on Ubuntu system. Let’s disable root user login for the phpMyAdmin for security purposes.

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

5 Comments

  1. Avatar asd Reply
    August 24, 2020 at 7:47 pm

    how i save

    • Avatar asd Reply
      August 24, 2020 at 7:48 pm

      step 3 PLS HELP ME XD

      • Rahul Rahul Reply
        August 25, 2020 at 3:25 am

        To save file, Press ESC key to switch to command more. Then type : (colon) and type w after the colon and hit Enter.

  2. Avatar Jeff Ro Reply
    August 10, 2020 at 3:36 pm

    Thanks, that was a big help Rahul. Just a suggestion, I think

    `vi /etc/apache/conf-enabled/phpmyadmin.conf`

    should be

    `vi /etc/apache2/conf-available/phpmyadmin.conf`

    • Rahul Rahul Reply
      August 11, 2020 at 1:59 am

      Thanks Jeff, Updated tutorial.

Leave a Reply Cancel reply

Popular Posts

  • How to View or List Cron Jobs in Linux
  • How to Install PHP 8 on Ubuntu 20.04
  • How to Set Up SSH Tunnel with PuTTY
  • How to Install Tor Browser on Ubuntu 20.04
  • Issue with phpMyAdmin and PHP: Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”
  • How to Allow Remote Connections to MySQL
  • How to Install MySQL 8.0 on Ubuntu 20.04
  • How to Install Apache Kafka on Ubuntu 20.04
© 2013-2021 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy