Would you like to learn how to install WordPress using Docker on Ubuntu Linux? In this tutorial, we are going to show you all the steps required to perform the WordPress installation using Docker on a computer running Ubuntu Linux in 5 minutes or less.

• Ubuntu 20.04
• Ubuntu 18.04
• Ubuntu 19.04
• WordPress 5.5.1
• MariaDB 10.5.5

Tutorial WordPress – Docker Installation

Install the Docker service.

Copy to Clipboard

Download the MariaDB docker image from the online repository.

Copy to Clipboard

Download the WordPress docker image from the online repository.

Copy to Clipboard

List the Docker images installed on your system.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Create a docker volume to store the MariaDB persistent data.

Copy to Clipboard

Verify the persistent data directory.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Optionally, create a symbolic link to an easier access location.

Copy to Clipboard

Start a MariaDB container with persistent data storage.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

In our example, the MariaDB image was used to start a new container.

The new container has persistent data storage.

The container ID is a3d93b7fd16f0c033f224852d7c5d67609e7f308be19cd9237d32a4986d4e378.

The database ROOT account password configured was kamisama123.

A database named WORDPRESS was created.

A database account named WORDPRESS was created and the password kamisama123 was configured.

Create a docker volume to store WordPress persistent data.

Copy to Clipboard

Verify the persistent data directory.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Optionally, create a symbolic link to an easier access location.

Copy to Clipboard

Start a WordPress container with persistent data storage.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

In our example, the WordPress image was used to start a new container.

The new container has persistent data storage.

The container ID is 6c3fb5af9250cc2c151e95d3a9b3f95f4a1827aaf7ad4708045b3cdb2fa442ba.

The WordPress container was linked to the MariaDB container.

Tutorial Docker – WordPress installation

Open your browser and enter the IP address of your web server.

In our example, the following URL was entered in the Browser:

• http://192.168.100.10

The WordPress web installation interface will be presented.

wordpress installation screen

After finishing the installation, the WordPress dashboard should be presented.

Wordpress dashboard

Congratulations! You have finished the WordPress Docker installation.

Tutorial WordPress – Docker container management

Verify the status of all Docker containers using the following command:

Copy to Clipboard

Verify the status of a container.

Copy to Clipboard

To stop a container, use the following command:

Copy to Clipboard

To start a container, use the following command:

Copy to Clipboard

To restart a container, use the following command:

Copy to Clipboard

In case of error, use the following command to verify the container logs.

Copy to Clipboard

In our examples, we demonstrated how to manage WordPress containers.