Launching a phpMyAdmin Docker container

I put together some easy to follow steps to launch a new phpMyAdmin Docker container to manage the database in your Wappler MySQL container.

Open PowerShell or whatever tool you’re using to operate your Docker containers.

Some parts of your command will be different from everybody else’s depending on your Wappler project settings. I indicated those parts in bold font.

Download a phpMyAdmin Docker image from the Docker Hub by running the command:
docker pull phpmyadmin/phpmyadmin

Find the name of the Docker network your Wappler containers are using by running the command:
docker network ls

The network your containers are using is the one named:
your project name__your target name_default

Write down the name because you will need it in a later step.

Find the name of your MySQL container by running the command:
docker container ls

Your MySQL container is the one named:
your project name__your target name_db_1

Write down the name because you will need it in a later step

Launch a phpMyAdmin container from the image you downloaded, give it a unique name (I’m using myadmin), and link it to your MySQL container through your Docker network on port 8080 by running the command:
docker run --name myadmin -d --link your project nameyour target name_db_1:db -p 8080:80 --network="your project nameyour target name_default" phpmyadmin/phpmyadmin

Now, open the myPHPAdmin UI by opening a web browser and entering the following URL in the address bar:
http://localhost:8080

6 Likes

Hi and welcome aboard. This is a very useful tip, one that I had been searching for. :love_you_gesture:

1 Like

I read where the link option is being discontinued and to use user-defined networks. could you show how to accomplish this with the userdefined networks method?

1 Like

Linking another post with further info and some troubleshooting about this topic.

2 Likes

For the sake of Docker, the Wappler network is considered a user defined network. To accomplish the topic of this post by connecting a phpMyAdmin container to your Wappler network, run the following commands replacing the names with names appropriate for your environment.

docker container run --name myadmin -p 8080:80 phpmyadmin/phpmyadmin
docker network connect yourwapplernetwork myadmin

If you want the phpMyAdmin container to automatically start with your OS, replace the docker container run command with this one and then run the docker network connect command.

docker container run --name myadmin --restart unless-stopped -p 8080:80 phpmyadmin/phpmyadmin

Maybe we should add an option in Wappler docker settings when entering the database options to also auto install myphpadmin for MySQL/MariaDB or pgadmin for Postgres

7 Likes

An option in the Wappler settings to automatically add phpMyAdmin for MySQL or pgadmin for Postgres would be very helpful, @George! I tried adding phpMyAdmin manually via @gruffigummi’s instructions but am seeing some warning messages.

@gruffigummi, I was able to get phpMyAdmin up and running as per your instructions. After logging in I noticed a couple of warning messages that I don’t get when I launch a phpMyAdmin from MAMP.

In the upper right hand corner of the index page (http://localhost:8080/index.php) it says that “SSL is not being used”. Should I be at all concerned about this?

Also, at the bottom of the index page it says that…

The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why.

Or alternately go to ‘Operations’ tab of any database to set it up there.

When I click on “Find out why” it takes me to another page (http://localhost:8080/chk_rel.php) that says…

Configuration of pmadb… not OK
General relation features Disabled

Create a database named ‘phpmyadmin’ and setup the phpMyAdmin configuration storage there.

Is this something that I should be concerned about in regards to this database (or the phpMyAdmin install itself) not having been properly created or not functioning properly? I don’t know what “general relation features disabled” means, but I’m guessing that it may not be ideal for a relational database like MySQL.

In regards to the SSL error:
In a dev environment, I don’t typically worry about securing communication between my containers with TLS/SSL. In a production environment, if my containers are on two separate machines, I would definitely configure TLS secure communication between the phpMyAdmin and the MySQL container. If the containers are on the same machine I would still configure secure communication, but I’m a better safe than sorry kind of person and am willing to put in the extra effort. Many people wouldn’t worry about it.

In regards to the configuration storage message in phpMyAdmin:
A fresh install of phpMyAdmin does not have configuration storage configured. Whether or not you configure configuration storage depends on whether or not you plan to use the additional features it provides in your app. I am using some of them, so I did configure it by clicking the Create link you displayed in your screenshot. You can read more about configuration storage and some of the features it provides here:
https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage

1 Like

AMENDMENT TO ORIGINAL POST

In this post, I stated the names of your Wappler containers and network include, “your project name__your target name”

That is incorrect. It should be, “your project folder__your target name”

1 Like