• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to install PhpMyAdmin by using Docker Compose on Ubuntu 21.04

  • 00:36 lsb_release -a
  • 00:56 docker create mariadb:latest
  • 01:26 docker run --name mariadb -e MARIADB_ROOT_PASSWORD=linuxc -d mariadb:latest --port 3808
  • 02:27 docker ps
  • 02:44 vim docker-compose.yml
  • 03:23 docker-compose up
6840

To Install PhpMyAdmin by using Docker Compose on Ubuntu 21.04

Introduction:

Docker is a software platform that enables rapid development, testing, and deployment of applications. phpMyAdmin is a free software tool written in PHP that allows users to manage MySQL over the Web, as well as perform a wide range of operations on MySQL and MariaDB.

Installation Procedure:

Step 1: Check the OS version by using below command

root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 21.04
Release:	21.04
Codename:	hirsute

Step 2: Create a Mariadb Docker Image from official Docker Hub by using the below command

root@linuxhelp:~# docker create mariadb:latest
Unable to find image 'mariadb:latest' locally
latest: Pulling from library/mariadb
ea362f368469: Pull complete 
adb9a1b1379d: Pull complete 
ac5c95406850: Pull complete 
fa48d8b47ec1: Pull complete 
bcf1feb44ac3: Pull complete 
8a5de7784a0f: Pull complete 
b8724b8a281a: Pull complete 
a8a7c3f612d6: Pull complete 
39b09b59e889: Pull complete 
14bc3a6b0a94: Pull complete 
Digest: sha256:5a37e65a6414d78f60d523c4ddcf93d715854337beb46f8beeb1a23d83262184
Status: Downloaded newer image for mariadb:latest
3525eab40ea2e1ee53391473937df0b0983ed1290b5ecf89d9e55eb8a10a2894

Step 3: Run the Mariadb container with defining Environment variables by using the below command

root@linuxhelp:~# docker run --name mariadb -e MARIADB_ROOT_PASSWORD=linuxc -d mariadb:latest --port 3808
99729803a499aaffbc8c3a0489d99144727ddf87c480642e7c80fc578f698848

Step 4: View the Running Containers by using the below command

root@linuxhelp:~# docker ps
CONTAINER ID   IMAGE            COMMAND                  CREATED         STATUS         PORTS      NAMES
99729803a499   mariadb:latest   "docker-entrypoint.s…"   7 seconds ago   Up 6 seconds   3306/tcp   mariadb

Step 5: Create a docker-compose.yml file

root@linuxhelp:~# vim docker-compose.yml

version: '3.1'

services:
  db:
    image: mariadb:latest
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: linuxc

  phpmyadmin:
    image: phpmyadmin
    restart: always
    ports:
      - 8080:80
    environment:
      - PMA_ARBITRARY=1

Step 6: Execute the Docker Compose file by using below command

root@linuxhelp:~# docker-compose up
Creating network "root_default" with the default driver
Pulling phpmyadmin (phpmyadmin:)...
latest: Pulling from library/phpmyadmin
a2abf6c4d29d: Pull complete
c5608244554d: Pull complete
2d07066487a0: Pull complete
1b6dfaf1958c: Pull complete
32c5e6a60073: Pull complete
90cf855b27cc: Pull complete
8b0f1068c586: Pull complete
5355461305e8: Pull complete
ad1eec592342: Pull complete
e03fbc76cb78: Pull complete
1f5796e48b39: Pull complete
72fbe8e1d4e7: Pull complete
96edece66175: Pull complete
292dfb535cda: Pull complete
20d45132048e: Pull complete
5a29f1842d2f: Pull complete
edd6a10260cc: Pull complete
da400e036222: Pull complete
Digest: sha256:e8142907fdf14e700ae34b50e6b9637ea834a93912e41a3785341eb833b77c31
Status: Downloaded newer image for phpmyadmin:latest
Creating root_db_1         ... done
Creating root_phpmyadmin_1 ... done
Attaching to root_db_1, root_phpmyadmin_1
db_1          | 2022-01-19 20:46:06+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.5+maria~focal started.
phpmyadmin_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
phpmyadmin_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
phpmyadmin_1  | [Wed Jan 19 20:46:07.008925 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.51 (Debian) PHP/7.4.27 configured -- resuming normal operations
phpmyadmin_1  | [Wed Jan 19 20:46:07.011462 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
db_1          | 2022-01-19 20:46:07+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_1          | 2022-01-19 20:46:07+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.5+maria~focal started.
db_1          | 2022-01-19 20:46:07+00:00 [Note] [Entrypoint]: Initializing database files
db_1          | 2022-01-19 20:46:08 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
db_1          | 
db_1          | 
db_1          | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
db_1          | To do so, start the server, then issue the following command:
db_1          | 
db_1          | '/usr/bin/mysql_secure_installation'
db_1          | 
db_1          | which will also give you the option of removing the test
db_1          | databases and anonymous user created by default.  This is
db_1          | strongly recommended for production servers.
db_1          | 
db_1          | See the MariaDB Knowledgebase at https://mariadb.com/kb or the
db_1          | MySQL manual for more instructions.
db_1          | 
db_1          | Please report any problems at https://mariadb.org/jira
db_1          |

Step 7: Ping http://localhost:8080 in Browser

Snap 1

Step 8: Login with Database Credentials

Snap 2

Step 9: This is the PhpMyAdmin Dashboard

Snap 3

By this to install PhpMyAdmin by using Docker Compose on Ubuntu 21.04 has been completed

Tags:
connor
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

How to run a docker-compose.yml file in the background?

A

To run a docker-compose.yml file in the background use the command "docker-compose -d up"

Q

How to add Environment Variables by running the container?

A

To add Environtment Variables by running the container use command "docker run -e "

Q

Is MariaDB and MySQL are same?

A

MariaDB is forked from MySQL and it is a high-performing open-source relational database.

Q

What is a relational database?

A

A relational database is a type of database that stores and provides access to data points that are related to one another.

Q

What are some of the relational databases?

A

Some of the relational databases are Microsoft SQL Server, Oracle Database, PostgreSQL MySQL, MariaDB, and IBM DB2.

Related Tutorials in How to install PhpMyAdmin by using Docker Compose on Ubuntu 21.04

Related Tutorials in How to install PhpMyAdmin by using Docker Compose on Ubuntu 21.04

How to install Meld tool in Ubuntu
How to install Meld tool in Ubuntu
Feb 25, 2017
How to install Dconf-Editor on Ubuntu 18.04
How to install Dconf-Editor on Ubuntu 18.04
Jul 14, 2018
How to install and update OpenSSL on Ubuntu 16.04
How to install and update OpenSSL on Ubuntu 16.04
Mar 9, 2017
How to install GLib 2.0 on Ubuntu 17.04
How to install GLib 2.0 on Ubuntu 17.04
May 22, 2017
How to Install Android Emulator on Ubuntu 20.4.1
How to Install Android Emulator on Ubuntu 20.4.1
Jul 13, 2021
How To Install AnyDesk on Ubuntu 16.04
How To Install AnyDesk on Ubuntu 16.04
Apr 4, 2018
How to install Genymotion 2.12.1 on Ubuntu 18.04
How to install Genymotion 2.12.1 on Ubuntu 18.04
Jul 9, 2018
How to install Timeshift 18.4 on Ubuntu 18.04
How to install Timeshift 18.4 on Ubuntu 18.04
Jul 6, 2018

Related Forums in How to install PhpMyAdmin by using Docker Compose on Ubuntu 21.04

Related Forums in How to install PhpMyAdmin by using Docker Compose on Ubuntu 21.04

Ubuntu
matthew class=
Failed to enable unit: Refusing to operate on linked unit file sshd.service
Apr 15, 2019
Ubuntu
mason class=
Passwd: You may not view or modify password information for root On Ubuntu 19.04
May 27, 2019
Ubuntu
isaac class=
/etc/apt/sources.list Permission denied
May 18, 2017
Ubuntu
yousuf class=
lsb_release command not working : Debian
Jan 18, 2018
ifconfig command
jackbrookes class=
what is the location of the ifconfig program on your machine?
Jan 4, 2018
Ubuntu
mason class=
"E: Package 'php-mcrypt' has no installation candidate" error on Ubuntu 20.4.1
Mar 15, 2021
NFS
luke class=
clnt_create: RPC: Program not registered
Apr 25, 2017
Apache
isaac class=
How to disable apache welcome page on Ubuntu
Dec 15, 2018

Related News in How to install PhpMyAdmin by using Docker Compose on Ubuntu 21.04

Related News in How to install PhpMyAdmin by using Docker Compose on Ubuntu 21.04

How To Install Mixxx on Ubuntu 16.04
How To Install Mixxx on Ubuntu 16.04
Oct 11, 2017
Ubuntu 17.04 released with greater expectations
Ubuntu 17.04 released with greater expectations
Apr 15, 2017
Ubuntu Core now available on i.MX6 based TS-4900 thanks to Technologic Systems Inc.
Ubuntu Core now available on i.MX6 based TS-4900 thanks to Technologic Systems Inc.
Mar 1, 2017
Ubuntu 17.10 Artful Aardvark Beta 1 is now here. Download Now
Ubuntu 17.10 Artful Aardvark Beta 1 is now here. Download Now
Sep 2, 2017
Ubuntu Unity is no more: One Linux dream has been axed
Ubuntu Unity is no more: One Linux dream has been axed
Apr 7, 2017
What’s next for Ubuntu Linux Desktop?
What’s next for Ubuntu Linux Desktop?
Apr 11, 2017
Say Hi to Ubuntu's new mascot
Say Hi to Ubuntu's new mascot
Mar 22, 2019
KDE Connect App was removed from Google Play Store and brought back in 24 hours
KDE Connect App was removed from Google Play Store and brought back in 24 hours
Mar 22, 2019
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Owen ?
How to add SSH key to my Gitlab account

I need to add the SSH key in my gitlab account. How to do so ????

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.