Install phpMyAdmin on Ubuntu 22.04

This tutorials is going to take you through on how to Install phpmyadmin on Ubuntu 22.04. phpMyAdmin is a MySQL and MariaDB administration tool that is free and open source. It has become one of the most popular MySQL administration tools, particularly for web hosting services. Users can easily create, update, and delete tables and fields, as well as add, remove, and alter data, run SQL queries, and manage user privileges.

How to Install phpMyAdmin on Ubuntu 22.04

To install phpMyAdmin on Ubuntu 22.04, you need to have LAMP stack installed first. Check out our article on how to Install LAMP stack.

Install phpMyAdmin on Ubuntu 22.04

  • Run the command below to install phpMyAdmin.
sudo apt install phpmyadmin

Sample output

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  dbconfig-common dbconfig-mysql icc-profiles-free
  javascript-common libjs-codemirror libjs-jquery
  libjs-jquery-mousewheel libjs-jquery-timepicker
  libjs-jquery-ui libjs-sphinxdoc libjs-underscore
  libmcrypt4 php-bz2 php-google-recaptcha
  php-mariadb-mysql-kbs php-mcrypt php-mysql
  php-nikic-fast-route php-phpmyadmin-motranslator
  php-phpmyadmin-shapefile php-phpmyadmin-sql-parser
  php-phpseclib php-psr-cache php-psr-container
  php-psr-log php-symfony-cache
  php-symfony-cache-contracts php-symfony-config
  php-symfony-dependency-injection
  php-symfony-expression-language
  php-symfony-filesystem
  php-symfony-service-contracts
  php-symfony-var-exporter php-tcpdf php-twig
  php-twig-i18n-extension php-xml php8.1-bz2
  php8.1-mcrypt php8.1-mysql php8.1-xml
Suggested packages:
  libjs-requirejs libjs-jquery-ui-docs libmcrypt-dev
  mcrypt php-dbase php-libsodium php-gmp
  php-symfony-yaml php-symfony-finder
  php-symfony-proxy-manager-bridge php-imagick
  php-twig-doc php-recode php-gd2
  php-pragmarx-google2fa-qrcode
  php-code-lts-u2f-php-server
  php-paragonie-sodium-compat
The following NEW packages will be installed:
  dbconfig-common dbconfig-mysql icc-profiles-free
  javascript-common libjs-codemirror libjs-jquery
  libjs-jquery-mousewheel libjs-jquery-timepicker
  libjs-jquery-ui libjs-sphinxdoc libjs-underscore
  libmcrypt4 php-bz2 php-google-recaptcha
  php-mariadb-mysql-kbs php-mcrypt php-mysql
  php-nikic-fast-route php-phpmyadmin-motranslator
  php-phpmyadmin-shapefile php-phpmyadmin-sql-parser
  php-phpseclib php-psr-cache php-psr-container
  php-psr-log php-symfony-cache
  php-symfony-cache-contracts php-symfony-config
  php-symfony-dependency-injection
  php-symfony-expression-language
  php-symfony-filesystem
  php-symfony-service-contracts
  php-symfony-var-exporter php-tcpdf php-twig
  php-twig-i18n-extension php-xml php8.1-bz2
  php8.1-mcrypt php8.1-mysql php8.1-xml phpmyadmin
0 upgraded, 42 newly installed, 0 to remove and 0 not upgraded.
Need to get 16.1 MB of archives.
After this operation, 71.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.1-mcrypt amd64 3:1.0.4-7+ubuntu20.04.1+deb.sury.org+3 [16.3 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libmcrypt4 amd64 2.5.8-3.4 [64.6 kB]
Get:3 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php-mcrypt amd64 3:1.0.4-7+ubuntu20.04.1+deb.sury.org+3 [3,328 B]
Get:4 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 dbconfig-common all 2.0.13 [586 kB]
Get:5 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.1-bz2 amd64 8.1.3-1+ubuntu20.04.1+deb.sury.org+1 [10.7 kB]
Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php-bz2 all 2:8.1+92+ubuntu20.04.1+deb.sury.org+2 [7,292 B]
Get:7 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu focal/main amd64 php-google-recaptcha all 1.2.4-3+focal1 [17.1 kB]
Get:8 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu focal/main amd64 php-mariadb-mysql-kbs all 1.2.12-1+focal1 [31.5 kB]
Get:9 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.1-mysql amd64 8.1.3-1+ubuntu20.04.1+deb.sury.org+1 [116 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 dbconfig-mysql all 2.0.13 [1,136 B]
Get:11 http://us.archive.ubuntu.com/ubuntu focal/main amd64 icc-profiles-free all 2.0.1+dfsg-1 [549 kB]
Get:12 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php-mysql all 2:8.1+92+ubuntu20.04.1+deb.sury.org+2 [7,288 B]
Get:13 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu focal/main amd64 php-phpmyadmin-motranslator all 5.2.0-1+focal2 [11.2 kB]
Get:14 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu focal/main amd64 php-phpmyadmin-shapefile all 2.1-5+focal1 [44.9 kB]
Get:15 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu focal/main amd64 php-phpmyadmin-sql-parser all 5.4.1-1+focal1 [74.0 kB]
Get:16 http://us.archive.ubuntu.com/ubuntu focal/main amd64 javascript-common all 11 [6,066 B]
Get:17 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libjs-jquery all 3.3.1~dfsg-3 [329 kB]
Get:18 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu focal/main amd64 php-tcpdf all 6.4.4+dfsg1-1+focal1 [7,799 kB]
Get:19 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libjs-jquery-mousewheel all 1:3.1.13-2 [5,836 B]
Get:20 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libjs-jquery-ui all 1.12.1+dfsg-5 [232 kB]
Get:21 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libjs-jquery-timepicker all 1.2-1 [27.5 kB]
Get:22 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 libjs-underscore all 1.9.1~dfsg-1ubuntu0.20.04.1 [99.5 kB]
Get:23 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libjs-sphinxdoc all 1.8.5-7ubuntu3 [97.1 kB]
Get:24 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 php-nikic-fast-route all 1.3.0-1 [12.8 kB]
Get:25 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 php-psr-cache all 1.0.1-2 [5,300 B]
Get:26 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 php-psr-log all 1.1.2-1 [8,268 B]
  • When you are asked to select web server, press space bar to select apache then enter to confirm.
  • Next, select yes to configure your database.
  • You will be required to enter database password.
  • Then confirm the password you entered.
  • After the installation, restart Apache server using the following command.
sudo systemctl restart apache2

Sample output

● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor >
     Active: active (running) since Tue 2022-03-15 06:02:26 CDT; 1h 3min a>
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 4397 (apache2)
      Tasks: 6 (limit: 2234)
     Memory: 20.0M
        CPU: 769ms
     CGroup: /system.slice/apache2.service
             ├─ 4397 /usr/sbin/apache2 -k start
             ├─23565 /usr/sbin/apache2 -k start
             ├─23566 /usr/sbin/apache2 -k start
             ├─23567 /usr/sbin/apache2 -k start
             ├─23568 /usr/sbin/apache2 -k start
             └─23570 /usr/sbin/apache2 -k start

Mar 15 06:02:26 ubuntu systemd[1]: Starting The Apache HTTP Server...
  • You can access phpMyAdmin through the following URL i.e. server-IP/phpmyadmin or localhost/phpmyadmin, enter user name e.g. phpmyadmin and password you created above.
  • You will be taken to the dashboard when you login.
  • You can create database by clicking on the database tab, enter your your database name then click create button.
  • Your database will be displayed on the left column, click it to create tables.
  • You have reached the end of the article, Congratulations. You have learned how to Install phpmyadmin on Ubuntu 22.04.

Read more on phpMyAdmin Documentation

Other Tutorials

Install LAMP Stack on Debian 11

Install WordPress with LAMP Stack on Ubuntu 22.04

Install WordPress with LEMP Stack on Ubuntu 22.04

System administrator | Software Developer | DevOps

Leave a Comment