Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Last Updated on: 19th June 2023, 11:21 am
I am deploying Adminer 4.8.1, a database management tool using Docker Compose to manage databases using GUI. I deployed MariaDB in the previous post and showed how to manage it using Console. Some of us like GUI instead of Console. So this post is for the people who like to manage databases using GUI.
Adminer is a database management tool with a beautiful GUI who wants to use GUI-based database administration instead of Console.
I am deploying Adminer 4.8.1, a database management tool using Docker Compose to manage databases using GUI. I deployed MariaDB in the previous post and showed how to manage it using Console. Some of us like GUI instead of Console. So this post is for the people who like to manage databases using GUI.
Let’s start with actual deployment…
Summary
Please make sure you should fulfill the below requirements before proceeding to the actual deployment.
Adminer ( formerly phpMinAdmin) is a database management tool with a beautiful GUI who want to use GUI instead of Console. We can use it for managing content in MySQL, MariaDB, PostgreSQL, MS SQL, SQLite, Oracle, Firebird, SimpleDB, Elasticsearch, and MongoDB. Adminer is distributed under Apache license (or GPL v2) in a form of a single PHP file (around 470 KB in size).
phpMyAdmin is one of the most famous tools for managing the MySQL database. However, it is not perfect which is the reason why Adminer has been created. The most important differences are:
Please go through the below link for the full features of Adminer.
https://www.adminer.org/en/phpmyadmin/
Create a folder in /opt
directory to place configuration file, i.e, .yml
file for Adminer.
Use the below commands to create the folder.
cd /opt
sudo mkdir -p adminer
cd adminer
sudo touch adminer.yml
Open adminer.yml
created earlier with nano editor using sudo nano adminer.yml
Copy and paste the below code in adminier.yml
Here is the docker compose
file for adminer
.
version: "3.7"
services:
adminer:
depends_on:
- testdb
image: adminer
ports:
- '5000:8080'
environment:
- PMA_HOST=testdb:3306
- MYSQL_USER=testuser
- MYSQL_PASSWORD=password
networks:
- proxy
deploy:
placement:
constraints: [node.role == worker]
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.adminer.rule=Host(`dbadmin.example`)"
- "traefik.http.routers.adminer.tls=true"
- "traefik.http.routers.adminer.tls.certresolver=default"
- "traefik.http.routers.adminer.entrypoints=websecure"
- "traefik.http.services.adminer.loadbalancer.server.port=8080"
networks:
proxy:
external: true
We need to map port 8080 to 5000 (any internal port) because port 8080 is used by traefik dashboard. That’s why we have to map it to internal IP address in configuration file.
I used Traefik stack that was deployed (
proxy stack
) earlier to Docker Swarm Cluster as a reverse proxy / load balancer.
Also proxy
docker overlay network for the application to be accessible externally.
Now it’s time to deploy our docker-compose file above adminer.yml
using the below command
docker stack deploy --compose-file adminer.yml adminer
You can give it any name for the stack. I just named it as
adminer
Check the status of the stack by using docker stack ps adminer
Now log into adminer interface by using URL in the configuration file, dbadmin.example.com (replace example.com
with your domain name
)
Make sure that you have DNS entry for your application (dbadmin.example.com) in your DNS Management Application.
Now log into it using the server name, username, and password
We can do a lot of database management tasks using Adminer smartly.
In the coming posts, I will show you how to deploy the most popular applications that are used in our day-to-day activities. WordPress, Rocker Chat, Wekan, Nextcloud, Flarum, Dolibarr ERP, Metabase, and many more to our Docker Swarm Cluster behind Traefik with Letsencrypt. Stay tuned… 🙂
I’ve learn some good stuff here. Certainly value bookmarking for revisiting.
I surprise how so much effort you place to create this type of excellent informative site.