News
3 new Serverspace GPT API Language Models available now!
BM
November 7 2022
Updated February 28 2025

How to install Wordpress and PhpMyAdmin using Docker Compose on Ubuntu 20.04

Docker FAQ Linux Ubuntu VPS

Introduction

Have you ever thought about creating your own website on WordPress? In this post I will show you how to install WordPress and PhpMyAdmin on Ubuntu 20.04 server using Docker ComposeToolkit for easily organizing complex applications that consist of many related containersLearn more.
Docker ComposeToolkit for easily organizing complex applications that consist of many related containersLearn more allows you to work with multi-container Docker applications by acting as its tool.
It requires Docker to be pre-installed, in our case we will use the pre-installed version of Docker.
You can use the instructions or create a server in Serverspace with Docker already installed.

What's required

  • Docker installed on your server, you can install it use to our instructions.
  • Server under Linux Ubuntu 20.04 operating system
  • 4 Gb of RAM or more

Checking the readiness of the system

First of all, let's check if Docker is running on your server using the command.

systemctl status docker
Copy

The parameter "active" has to be "running".

Update the packages on the server.

For future installation, you need to install curl package, you will need it to install Docker Compose.

sudo apt-get install curl -y
Copy

Installing Docker Compose

The latest version of Docker Compose is 2.12.2, use the command below to download the repository to your server. You can check the latest version here.

sudo curl -L "https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)" -o /home/docker-compose
Copy

Note: The repository will be located at /home/docker-compose.

After installation, the downloaded repository needs to be made executable.

To check, you can use the ls -la command to check the permissions on the folder.

Copy the repository to the system path.

sudo mv /home/docker-compose /usr/local/bin/
Copy

Check the installation by running the command docker-compose, it will give you a list of possible commands.

Note: If you get the -bash: /usr/local/bin/docker-compose: No such file or directory error at startup, check that you copied the repository into the system folder. You might get an error -bash: /usr/local/bin/docker-compose: Permission denied, it says that the repository is not executable, give it the rights using the command above.

Installing WordPress and MySQL



Before installing, we have to create the directory and the config for our Docker Compose.

mkdir wordpress
Copy

And also create a config.

nano wordpress/docker-compose.yml
Copy

In this config, we need to specify the image of wordpress, and the image database MySql, which is needed to run WordPress.

Note: You can change the port to whatever you want.

Run docker to download and check your config.

After launching, it is already possible to go to the web page of our wordpress site, using "https://yourip:8080".

Installing PhpMyAdmin

Before installing it, turn off docker compose.

sudo docker-compose down
Copy

To install, you will need to go back to our docker config, and enter the image and network parameters.

To install and verify that it works, run docker.

sudo docker-compose up
Copy

After launching, go to the web page using "https://yourip:8081".

The installation is successfully completed.

Conclusion

Docker, allows you to install different packages in just a couple of minutes, thereby saving you time. Thanks to it, you can install any version of a certain package to test your plugins and programs.
Thanks to this publication, you can easily deploy your own site on WordPress, as well as a web interface for the administration of DBMS MySQL - PhpMyAdmin.

Vote:
4 out of 5
Аverage rating : 4.6
Rated by: 11
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
ITGLOBAL.COM NL
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.