7 July 2023
MariaDB is one of the most popular open source relational database management systems in the world, and on the other hand, PhpMyadmin is another great stable and also free software tool written in PHP that serves to manage both databases on a MySQL server and MariaDB.
And docker will be the tool that will help us to run these two services in an easy and fast way, with data persistence. So we will have an environment ready in a few minutes to continue working.
Requires docker installed
Create a folder in your project directory and inside it a
docker-compose.yml file with the following content:
version: "3.8" services: mysql: image: mariadb:latest ports: - 3306:3306 environment: MYSQL_ROOT_PASSWORD: rootpass MYSQL_USER: abc MYSQL_PASSWORD: abc123 volumes: - mysql:/var/lib/mysql restart: unless-stopped phpmyadmin: image: phpmyadmin:latest ports: - 8080:80 environment: PMA_HOST: mysql PMA_USER: auser PMA_PASSWORD: pass12345 restart: unless-stopped volumes: mysql:
Save the changes and then raise the containers with the following command:
docker compose up
If you want to leave the containers running in background don’t forget the
-d flag. You will be able to access PhpMyadmin in your browser at
And that’s it. Important: You can use whatever credentials you want as long as it is a local development environment and do not pretend to use this docker compose definition in a productive environment.