When you are working on diverse projects on your own or with other developers as a team it takes some time at the beginning of the project to make the setup on your local environment and then to setup the project in the same manner for all your team members. Later, when you want to onboard new team members to the project you might also spend some time with helping them.
Then you might have to do this over and over again, for other projects you are developing.
Mimic Specific Environments
It is not always easy to mimic as much as possible a production/staging environment with all the necessary versions of services, so starting to actually code on a project is delayed because you first have to make sure the environment you need for development is prepared.
There are preconfigured recipes you can start with (Backdrop, Drupal 6 -> 8, Joomla, Laravel, MEAN, LAMP, LEMP, Pantheon, WordPress) or you can create your custom recipes, depending on what your projects requirements are.
Scripted Setup = Automated Setup
What if we could eliminate variability from developer to developer by scripting most of the project setup, and in this way to easily automate all the steps?
This would drastically minimize the amount of time required for setting up the project.
Automate Your Setup With Lando
Lando is a solution for developers who want to quickly specify and painlessly spin up the services and tools needed to develop their projects.
It’s a free, open source, cross-platform, local development environment and DevOps tool built on Docker container technology and developed by Tandem.
Your Local Development’s Dependency Management Tool
Designed to work with most major languages, frameworks and services, Lando provides an easy way for developers of all types to specify simple or complex requirements for their projects, and then quickly get to work on them.
Think of it as your local development’s dependency management tool.
In order for you to experience all the awesome Lando power a .lando.yml file needs to exist in the root directory of your project. The file will contain all the things you need for running and developing your project.
The ideal workflow is:
- A developer creates the project .lando.yml file and passes this file to all the team members (added to version control or shared in another way), or reuse this file for other projects too.
- Once the file is created, all is needed for anyone else to do is to simply run the lando start command and will get equipped with all the things needed.
Before starting with a project setup, you have to install Docker (you can read more and see instructions at https://www.docker.com/get-docker), then follow the steps from https://docs.devwithlando.io/installation/installing.html
Don’t forget to also check the system requirements before, to make sure your system is compatible with Lando https://docs.devwithlando.io/installation/system-requirements.html
Easy Setup a WordPress Instance
The simplest way to get a WordPress instance up and running on your local machine is to follow some simple steps:
mkdir instance1 && cd instance1
At this point you see that there is a .yml file created in the root of your project. You can check the wordpress recipe, copy and adjust what you need from the official documentation at https://docs.devwithlando.io/tutorials/wordpress.html, then run lando rebuild to equip your local instance based on the latest changes you made to the lando configuration file.
Custom WordPress Setup with Lando & WP-CLI
I will show you a custom setup, using my own scripted events, taking advantage of the powerful WP-CLI, since we are aiming to setup a WordPress local instance.
You can find the Lando official documentation at https://docs.devwithlando.io/.
Happy to Share
The slides are available at https://docs.google.com/presentation/d/1K9Xlu0lU5l0k6Lcz_qQjblbaUQ4L0LcJtbYNhfJHXR0/edit?usp=sharing
You can find more WordPress related work on my website and on my wordpress.org profile at https://profiles.wordpress.org/iulia-cazan#content-plugins.
See other tips & tricks
How to fix translation in multi-language website + WooCommerce + AJAX checkout I have been working recently on a multi-language website that is using WooCommerce > 3.5…
How to Integrate Google reCAPTCHA v3 in Forms that Use AJAX Validation I recently had to update one of the sites that is using Google reCAPTCHA to…