While you can work with MariaDB / MySQL directly from the command-line you don't have to, especially if you already have a web server on the host. Since the myPhpAdmin application is provided by the hosting provider it makes sense to add it to the Dev and Test systems too.

This is based on my Dev & Test Joomla 4 virtual machines that are currently running Ubuntu 20.04. The phpmyadmin package is in the default universe/web repository so the basic installation is really simple.

Install phpmyadmin package

Login to your host and install the package with apt

sudo apt install phpmyadmin

You will be prompted for web server being used so the package can configure it for you.

phpmyadmin webserver autoconfiguration choice

Press space to pick apache2 then tab to OK and press enter to continue the install.

After a few minutes downloading you will then be prompted to autoconfigure the database.

myphpadmin database autoconfig prompt

Since I already have Joomla installed on these hosts with its database I'm taking the advice not to let it do this. It just means we will need to add an admin user at a later step. The installation adds a config file to /etc/apache2/conf-enabled and we need to restart apache2 for this to take effect

systemctl restart apache2

Test initial access from a browser the host with /phpmyadmin in the URL e.g. http://joomla-test.example.com/phpmyadmin just to be sure it's working, but we can't use it just yet.

Configure the Admin User

Since we didn't let the installer configure everything for us, the next step is to configure a dedicated user with a password so we don't have to enable password authentication for the root user.

Login to MariaDB as the root user, or any other user with enough permissions to create a user.

root@myhost:~# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12646
Server version: 10.3.38-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create user myadminuser identified by 'MyAdminPassword';
Query OK, 0 rows affected (0.199 sec)

MariaDB [(none)]> grant all privileges on *.* to myadminuser;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.046 sec)

MariaDB [(none)]> quit
Bye

Replace both occurances of myadminuser with the username of your choice, and also replace MyAdminPassword with a suitably complex password of your choosing too. You should now be able to login to phpMyAdmin e.g via http://joomlahost.example.com/myphpadmin as the user you've just created.

phpMyAdmin login screen

For internet and other public-facing sites additional security is recommended for phpMyAdmin such as setting up the Apache .htaccess authentication in addition to the user we've just created.

Since these hosts are on a private subnet I don't see the need right now. If I ever need to make them accessible then all public access to internal resources is via a reverse proxy that filters on URL anyway so I can use that to deny access as well.