I love PhpMyAdmin because it was straightforward to set up for any app and fix the table database or troubleshoot. So, we will set up PhpMyAdmin with nginx SSL secure for our HTTPS. We would rather not expose this on HTTP due to grabber username and password exploits…
Make sure you do this first! Before starting build this because this tutorial is always requirement to make app prevent hack and expose our port to the public… we don’t want that to happen. We only want open 80 and 443 that it.
After you complete Portainer and nginx, then we are good to go to build this app with nginx and PhpMyAdmin.
Open Portainer → Stacks→ create stacks
version: '3' services: pma: networks: - nginx - mariadb image: phpmyadmin/phpmyadmin container_name: pma environment: PMA_ARBITRARY: 1 restart: always #ports: # - 8081:80 networks: nginx: external: true mariadb: external: true
I added hashtag comments on ports and Port number because we don’t need these, and we just will use nginx network on this app. So, nginx proxy can communicate with PhpMyAdmin instead of port or public. It more secure to build our app before publishing to the public. They can inject your sites with HTTP or any insecure port.
Then deploy the stacks and now your PhpMyAdmin is online but will not show up on site because you haven’t set up nginx Proxy details. So that our next step.
Open nginx proxy manager your site. My will be nginxadmin.richardapplegate.io.
Then you will need to log in to your admin account. Then add proxy host, then fill this detail.
Now you may open your site with a domain without port. My will be phpmyadmin.richardapplegate.io. and working!
Then you are in database MariaDB system