I was looking for the shortest way to learn something about Docker. I have heard a lot of praise about Docker and the opportunity it gives to build up any development environment in a snap of fingers.
The principle of Docker is containerization, so you can build any specific virtual environment that you want : a certain version of PHP with MySQL plus any version of a CMS such as WP, Drupal or a framework such as Symfony or Laravel and share it with anyone.
It is a very good alternative to a local desktop server such as MAMP or XAMPP where everything is almost set by default.
For me, the purpose was to use Docker to install WordPress and withdraw definitively from MAMP. I want to stop working on a non scalable and non shareable environment. I still wanted to have a local environment but easily shareable on a global scale!!! To mock the marketing antiphon, I wanted to “think global, develop local”.
I have tried Docker, definitely it is cool but I had to search on Google to answer to the question “Where the heck are the WordPress’s files when you install it through Docker?” So meanwhile looking for Docker, I bumped into Lando. Thanks to FOG who has given me the itch to discover this program Lando.
Lando correspond much more to what I was looking for. It is the tool to manage your dev environments.
Relying on Docker, Lando raises the level of assistance higher for what they call in their documentation “RECIPES”. You can virtually build any development environment you want from WordPress to Node passing by Drupal 6, Drupal 7, Drupal 8, Joomla, Laravel, LAMP…etc.
Here is a quick way to use Lando to install WordPress.
Let’s do the easy way by following the step by step given by Lando itself.
In few lines, the way you can install WordPress with Lando in a directory name
my_wp_lando_2. It will create a
$ cd /the-path-to-your-lando-install/ $ mkdir my_wp_lando_2 $ cd my_wp_lando_2 $ lando init --recipe=wordpress --vv $ lando wp core download
To launch, the installation, you have to be in the correct directory.
$ lando start
Launching the WordPress Install
In order to fill up the form for the WP install operation
dbname:wordpress username:wordpress password:wordpress dbname_host:database
Change your installation
I have decided to change my installation and add to this lando’s container, phpmyadmin. I will just have to edit the file
.lando.yml at the root of my directory.
name: my-wp-lando-app recipe: wordpress config: webroot: . database: mysql services: pma: type: phpmyadmin host: - database
The name of my application is
my-wp-lando-app. As I have changed enough the .lando.yml file, I am force to rebuild my application.
#If you change more deeply the .lando.yml file, you will be forced to rebuild $ lando rebuild #To stop from inside of an app directory $ lando stop #To start from inside of an app directory $ lando start
There is a new url for the phpmyadmin
You can check the WP database
Physically, the files are accessible via your favourite editor. You can add plugins, edit themes… etc… If you kill your application, the files will remain in your Lando directory.
Other useful commands in Lando
Some other commands that you should know.
If you want the complete information about your application
$ lando info
Some other command to stop, restart…etc.
#If you only add a service $ lando restart #To stop from inside of an app directory $ lando stop #To start from inside of an app directory $ lando start #To stop from outside of an app directory lando stop my-wp-lando-app #To start from outside of an app directory lando start my-wp-lando-app #To kill from inside of an app directory. My app name is my-wp-lando-app $ lando destroy my-wp-lando-app
Conclusion: Lando is a great tool that simplify the usage of Docker. The documentation is very well done. You can take it in hand without difficulties. No headache to understand how to make evolution in some of your containers.
- The excellent LANDO documentation
- Using Lando, Docker and WordPress
- Great youtube video on Lando + WordPress
- The official Lando youtube channel
- A good introduction to Lando with this modest statement: “The Future of Dev is Now!!!”
- My WordPress Development Workflow 2018
- Working with WordPress
- Local Development with Lando
- How to setup a local development environment in 5 minutes
- Create A WordPress Site With Lando
- Drupal and Docker the easy way with Lando
- Docker: the Enterprise Container Platform
- Using Docker for WordPress Theme & Plugin Development
- Using Docker for WordPress Development
- How to Use the Official Docker WordPress Image
- Docker + WordPress Setup
- WordPress Automated Deployments using Bitbucket and Jenkins
- A WordPress & Git workflow
- Docker Workflow with WordPress
- WPDC – WordPress Docker Compose
- Deploying WordPress with Docker
- Using Devilbox for Local WordPress Development in Docker
- How to Use Git for WordPress Development
- No More Cowboy Coding: Improving Your WordPress Workflow
- An Efficient WordPress Development Workflow
- Installer WordPress sur Docker facilement en 2 étapes
- Installer et utiliser WP-CLI pour gérer son blog WordPress
- Deploying WordPress with Docker Stack (Compose) – Journey 1
- How To Install WordPress and PhpMyAdmin with Docker Compose on Ubuntu 14.04
- YAML Validator