Install Docker

Update the repo to get latest versions

sudo apt update

Install the latest version

sudo apt install docker.io

Set Docker to start on startup

sudo systemctl enable --now docker

Give your user permissions to docker, replacing user with your username

sudo usermod -aG docker user

Test it has installed correctly by getting the docker version

docker --version

Installing Phpymyadmin

Download the latest Phpymyadmin docker

docker pull phpmyadmin/phpmyadmin:latest

Running Phpymyadmin

Create the phpmyadmin network in Docker

docker network create phpmyadmin-network

Run the docker image, change the PMA_HOST to your server ip, and i’ve also set it to run on port 8182. Change this to a different port if you want.

docker run -d --name phpmyadmin -p 8182:80 --network phpmyadmin-network -e PMA_HOST=serverip phpmyadmin/phpmyadmin

Once running, open a browser and run to http://serverip:8182.

Try to log in with your root account. If you get access denied, grab the error like Access denied for user 'root'@'dockerip' (using password: YES)

On your server run the below and enter your password when prompted.

sudo mysql -u root -p

Then create the user that is specified in the above command. (Please change the password at the end to a secure password) and the dockerip for the ip from the error.

create user 'root'@'dockerip' identified by 'your-password';

Grant privileges to the above account, again changing dockerip for the ip from the error

grant all privileges ON *.* TO 'root'@'dockerip';

Flush privileges and exit

flush privileges;
exit;       

Go back to the browser and try login with that root account, you will now be able to get in.