Lando
Lando provides a stable, easy-to-use, and portable local development environment. It allows you to integrate phpMyAdmin (among other services) and simplifies setting up XDebug.
Warning
This is a development tool! Note that while you can run Lando in production, it is highly discouraged, not recommended and 100% not supported! DON'T DO IT!
UserFrosting ships with a default landofile in .lando.dist.yml, using the dist format. This enables conflict free overrides, which means you can overwrite this in your own project by creating a .lando.yml landofile to customized it to your needs.
But for most people, the default configuration should be fine. With the included landofile, the following is supported;
- Support for sending and viewing of mail with MailHog (only 1 simple config change needed), with custom URL.
- Pre-configured PHPMyAdmin, with custom URL.
- Composer managed by Lando, and exposed via Lando CLI.
bakerycommand exposed via Lando CLI.redis-clicommand exposed via Lando CLI (haven't verified config here, I probably should).phpunitcommand exposed via Lando CLI.- User keys and tokens pulled in, avoiding a host of auth frustrations normally associated with container based dev tools
Installation Steps
Install Lando
Start by installing Lando.
Clone UserFrosting
Once you've installed Lando, we can use UserFrosting built-in support for Lando to spin up a container with the appropriate configuration. In a directory of your choice, use git to clone the UserFrosting repository into a new directory :
git clone https://github.com/userfrosting/UserFrosting.git
Next, cd into your new UserFrosting dir :
cd UserFrosting
1st Time Lando Start-up
Using the terminal, run lando start from within your UserFrosting app. The first start up will take a brief period to install everything and set up the docker components.
When the application boots successfully, you'll see something like:
___ __ __ __ __ ______
/ _ )___ ___ __ _ ___ / / ___ _/ /_____ _/ /__ _/ /_____ _/ / / /
/ _ / _ \/ _ \/ ' \(_-</ _ \/ _ `/ '_/ _ `/ / _ `/ '_/ _ `/_/_/_/
/____/\___/\___/_/_/_/___/_//_/\_,_/_/\_\\_,_/_/\_,_/_/\_\\_,_(_|_|_)
Your app has started up correctly.
Here are some vitals:
NAME userfrosting
LOCATION /home/user/source/uf/framework
SERVICES appserver, database, cache, pma, mh
APPSERVER URLS https://localhost:49266
http://localhost:49267
http://userfrosting.lndo.site/
https://userfrosting.lndo.site/
PMA URLS http://localhost:49270
http://pma.userfrosting.lndo.site/
MH URLS http://localhost:49268
http://mh.userfrosting.lndo.site/
Install UserFrosting
Next, we need to install UserFrosting.
- Run
lando composer installto install UserFrosting's PHP dependencies using Composer. - Run
lando bakery baketo run UserFrosting'sbakecommand and follow the UserFrosting install steps, including the creation of your first admin user.
Accessing Your Site
Now that you have your application running, you can access it at http://userfrosting.lndo.site or any other url displayed in APPSERVER URLS from the previous steps.
Tip
Lando supports SSL as well, but if you get SSL certificate errors follow the guidance listed at Lando Security.
Additional tooling and services can be accessed via;
- phpMyAdmin : http://pma.userfrosting.lndo.site
- Bakery CLI :
lando bakery - PHPUnit :
lando phpunitandlando bakery test - Redis CLI :
lando redis-cli - ...and those documented at the Lando LAMP recipe docs.
Additional Lando Commands
- You can stop your Lando server by running
lando stop - You can start your Lando server again next time by running
lando start - Get database connection details and more at
lando info - If something went wrong and you want to try again, you can destroy your Lando instance (without erasing your application on your local machine) by running
lando destroy - Learn more commands and advanced usage tricks at https://docs.devwithlando.io