Using Lando, Docker and Wordpress
well… He is another Lando.
According to is description in github:
Lando is 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. 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. It can even be installed right beside an old Kalabox installation with no interference, or used as a complete upgrade-replacement.
Requirements for this tutorial
- Install Docker
- Install Lando
- Here you can read how to install Docker according to your operating system.
Here you can read how to install Lando from the official documentation.
Setting up word press and Lando
First before star running commands, We need a .lando.yml .
The above is our very basic lando file, you can see the recipe, name, proxy, web server’s config , database host and etc.
Putting WordPress, docker and Lando together
Preparing the container with Lando
In this part I’m going to explain you how to use Wordpress and Lando step by step.
1. Create a folder with the name wplando or whatever name.
2. Copy the .lando.yml in wplando.
3. Go to the folder by terminal.
4. Inside the folder execute: lando start
Now go to your favorite browser and Open http://wordpess.lndo.site
Now, the container is working but your site isn’t ready, because you haven’t download wordpress, so Lando doesnt download wordpress for your like It does with laravel for example.
Mixing Wordpress with Lando/docker
- Go to wordpress and download it.
- Descompress it
- Copy the files in wplando
- Set the proper database configuration in: wp-config.php
If you aren’t sure about the database configuration you can check it with the commando: lando info
Lando come in handy when you need to run a container quickly without complicated stuff.
My recommendation is, if you are going to use it try to learn a little about docker first, this will avoid you some headaches.