TUTORIAL

Easier working with the docker – warden, wordpress installation

In this article I will show you how to easily install WordPress with the docker with the warden tool. This tool makes it easier for us to work on our project environment, preparing many things for us. Therefore, someone who does not know the docker well can easily prepare the environment for a project using CLI warden.

This tool is only available for Linux and macOS, but unfortunately it is not supported on Windows.

To read about the topic of the docker read our previous article – Installation of WordPress and Docker with your own local domain

We install CLI warden on Linux Ubuntu

We will work on Linux Ubuntu 20.04.1 LTS. First we have to prepare our system and install the appropriate packages with docker and warden.

Docker installation

Use the command to install the docker:

Warden

Installation warden

We can carry out warden installations using Homebrew or clone from a repository.

Homebrew:

Git:

We create a WordPress project using warden and docker

Create a folder named example and go to it.

Inside the folder we start warden and establish our .env file using the commands:

After env-init we have to enter the name of our project: example, and then the project type: wordpress.

We compile our environment with functions:

In order to be able to use the site correctly, you need to add a certificate using it:

Now we can go to the SSH of our project example.test

Once we are in shell of our site, we download the latest version of WordPress and unpack and remove the package:

We add our website to the /etc/hosts file.

Finally, in order to be able to connect through the browser to our site we need to add our site to the hosts file. Go to the main folder of our system and enter:

We add a new line inside the file:

We can now connect to our site: https://example.test

We have received the WordPress configuration view

docker warden wordpress konfiguracja

S WordPress installation

We move on to the installation of WordPress. We will need the data to connect to the database and the host. These are in the .env file in our project folder – example. Go to the project folder and type in:

There are values there:

Here we have our database name, user name and password under DB_DATABASE, DB_USERNAME, DB_PASSWORD. .

We still need the name of the host. To do this, we enter the command in our console:

We receive a list of our active containers. The host name will be related to the mariadb engine:

In our case it is example_db_1.

In the configuration of our WordPress we enter our project data accordingly.
dane-konfiguracji-wordpress

We move on. Add a project name, user name and password. Done, we have received the WordPress project using the docker and warden tool.

wordpress-docker-warden

Summary

With CLI warden we created the WordPress project using docker. Preparation of the environment is very simple and fast, and with the help of warden we can run several containers with different WordPress projects and they will work locally at the same time without interfering with each other. Warden is quite a little known tool for a docker, but it is very effective and speeds up the process of creating a project environment.

I invite you to read our other articles – Useful articles.