Lando, Docker, Development – Discover quickly the potential of Lando with a simple WordPress install
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.
Installing Lando
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 .lando.yml
file
$ 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.
Read more
- The excellent LANDO documentation
https://docs.devwithlando.io/ - Using Lando, Docker and WordPress
https://medium.com/@22acacia_cr/using-lando-docker-and-wordpress-bb5f236d98b7 - Great youtube video on Lando + WordPress
https://www.youtube.com/watch?v=QW3io3MFPNg - The official Lando youtube channel
https://www.youtube.com/channel/UCl_QBNuGJNoo7yH-n18K7Kg/videos - A good introduction to Lando with this modest statement: “The Future of Dev is Now!!!”
https://www.youtube.com/watch?v=veRpPNaBY14 - My WordPress Development Workflow 2018
https://digisavvy.com/2018/05/wordpress-development-workflow-2018/ - Working with WordPress
https://github.com/lando/lando/blob/master/docs/tutorials/wordpress.md - Local Development with Lando
https://wpsessions.com/sessions/local-development-lando/ - How to setup a local development environment in 5 minutes
https://iuliacazan.ro/how-to-setup-a-local-development-environment-in-5-minutes/ - Create A WordPress Site With Lando
https://joshpress.net/create-a-wordpres-site-with-lando/ - Drupal and Docker the easy way with Lando
https://colorfield.be/blog/drupal-and-docker-the-easy-way-with-lando
About Lando
- Docker: the Enterprise Container Platform
https://www.docker.com/ - Using Docker for WordPress Theme & Plugin Development
https://russt.me/2017/04/using-docker-for-wordpress-theme-plugin-development/ - Using Docker for WordPress Development
https://threenine.co.uk/using-docker-wordpress-development/ - How to Use the Official Docker WordPress Image
https://www.sitepoint.com/how-to-use-the-official-docker-wordpress-image/ - Docker + WordPress Setup
https://davidyeiser.com/tutorial/docker-wordpress-theme-setup - WordPress Automated Deployments using Bitbucket and Jenkins
https://medium.com/@kcabading/wordpress-automated-deployments-using-bitbucket-and-jenkins-71450dacdcb0
- A WordPress & Git workflow
https://marcjenkins.co.uk/a-wordpress-git-workflow/ - Docker Workflow with WordPress
https://github.com/mdelapenya/wordpress-docker-workflow - WPDC – WordPress Docker Compose
https://github.com/nezhar/wordpress-docker-compose - Deploying WordPress with Docker
https://www.sitepoint.com/deploying-wordpress-with-docker/ - Using Devilbox for Local WordPress Development in Docker
https://deliciousbrains.com/devilbox-local-wordpress-development-docker/ - How to Use Git for WordPress Development
https://premium.wpmudev.org/blog/git-for-wordpress-development/ - No More Cowboy Coding: Improving Your WordPress Workflow
https://premium.wpmudev.org/blog/improve-wordpress-development-workflow-local-server/ - An Efficient WordPress Development Workflow
https://jasonyingling.me/efficient-wordpress-development-workflow/ - Installer WordPress sur Docker facilement en 2 étapes
https://www.hostinger.fr/tutoriels/docker-wordpress/#gref - Installer et utiliser WP-CLI pour gérer son blog WordPress
https://www.hostinger.fr/tutoriels/wp-cli/#gref - Deploying WordPress with Docker Stack (Compose) – Journey 1
https://www.youtube.com/watch?v=VW2bLY57U5c - How To Install WordPress and PhpMyAdmin with Docker Compose on Ubuntu 14.04
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-and-phpmyadmin-with-docker-compose-on-ubuntu-14-04 - YAML Validator
https://jsonformatter.org/yaml-validator