TUTORIAL

Installation of WordPress and Docker with your own local domain

In this article I will show you how to quickly and easily, without additional programs such as XAMPP or WampServer – place WordPress locally with your own local domain. This is possible with Docker, tool which allows to replace virtualization with containerization.

Containerization is a process that allows you to run the indicated applications in separate containers, which are separate instances of the runtime environment. Thanks to this solution, each container has its own memory area, network interface with IP address and disk area.

I have presented more or less what Docker is about, if you want to learn more I invite you to the article:

Docker for programmers, what is it?

Docker Desktop installation for Windows

In our case, we will operate on Windows. If you have Linux the installation is almost the same. Moreover Linux is in my opinion better and faster environment for Docker. In case of this project, which is only about creating WordPress image locally – we will operate on Windows.

We get Docker’s installer and run it on Windows

We are going to go to the site:

https://www.docker.com/products/docker-desktop

We select the system that interests us and download the installer.

We run the installer and install Docker Desktop for Windows.

Here you will find the installation documentation for Windows: https://docs.docker.com/docker-for-windows/install/.

After installation, run Docker Desktop for Windows.

Runrun WordPress with Docker Desktop for Windows

To run WordPress on our local machine with the help of Docker, we will use the solutions contained in the guide:

WordPress Local Development Using Docker Compose.

We are cloning the environment to fire WordPress on Docker

The first step will be to create a folder with our project. We create the folder in a selected location using Command Line:

Inside the folder we execute the command:

In this way, we clone a ready-made WordPress environment to be fired by Docker. You can download it manually by entering the link:https://github.com/kassambara/wordpress-docker-compose

We install WordPress by Docker

Now that we have the basic configuration files cloned, we go to the project folder:

We install our project with a command: