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.

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;

  1. Support for sending and viewing of mail with MailHog (only 1 simple config change needed), with custom URL.
  2. Pre-configured PHPMyAdmin, with custom URL.
  3. Composer managed by Lando, and exposed via Lando CLI.
  4. bakery command exposed via Lando CLI.
  5. redis-cli command exposed via Lando CLI (haven't verified config here, I probably should).
  6. phpunit command exposed via Lando CLI.
  7. 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.

  1. Run lando composer install to install UserFrosting's PHP dependencies using Composer.
  2. Run lando bakery bake to run UserFrosting's bake command 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.

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;

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

Further Reading