Docker has excellent growth in the last few years and still growing. It is everywhere – from startup to enterprise. Docker got some of the cool advantages over traditional VM, but this post is not to talk about that. If you are interested in learning in-depth, then I would recommend taking this online course. Back to topic… So you know or heard the Docker benefits and keen to try using for WordPress. Technically, there are many ways to do this but let’s check out EasyEngine which make life easier. I’ve following tested on Google Cloud, but technically, it should work on any cloud hosting like DigitalOcean, Linode, AWS, Alibaba Cloud. My Google Cloud instance is ready. and, logged in as a root EasyEngine is an automated script which needs to be installed on the server where you want to create a WordPress site. So let’s get it installed with the following commands. Note: EasyEngine doesn’t work on CentOS yet, so you got to use either Debian or Ubuntu. It will take a few minutes to install the necessary components including Docker, and you should see the following information before it returns to the prompt. This means EasyEngine is installed and ready to use to create a site. It depends on the requirement, and there are multiple types of sites you can create. Ex:

Just an HTML siteWordPress site without caching or extra featuresCreate a PHP-based site with a databaseA site with self-sign or let’s encrypt SSL certificateMulti-site WordPress sitesWP site on sub-domain or sub-directoryWP site with Redis cache

You see, there are multiple combinations possibility and you can always refer their official documentation. For now, let’s create a WP site with Redis. Above, I am asking EasyEngine to create a WP site for geekflarelab.com and use a cache. It will take a few seconds, and you should see a success confirmation like below. You see how fast it is to get your site up and running on the cloud? Great! Let’s verify what caching mechanism is used. and, as you can see, WP Redis is installed along with the site creation. WP is running inside the docker, but you don’t have to do anything for it as everything is managed by EasyEngine scripts. Most of the time, you would be interacting with ee scripts. However, if you want to explore services running inside the docker, then you can check out the following.

Processes inside the docker

docker ps would show all the running services. As you can see, Nginx, PHP, MariaDB, Redis, Nginx, etc. – all running inside the docker.

Memory, IO, CPU stats

docker stats will give you real-time utilization statistics

Logs location

I understand you need to review the logs for troubleshooting and time to time. You can find them here. Nginx & PHP – /opt/easyengine/sites/$SITENAME/logs EE is well structured, and if interested to learn more then I would recommend checking their handbook. Running WordPress inside the Docker is easy now! If you don’t want to manage WP server, optimization, security by yourself, then you may try Kinsta who take care of everything for you so you can focus on your core business.

How to Setup WordPress in Docker with EasyEngine  - 62How to Setup WordPress in Docker with EasyEngine  - 58How to Setup WordPress in Docker with EasyEngine  - 37How to Setup WordPress in Docker with EasyEngine  - 89How to Setup WordPress in Docker with EasyEngine  - 86