Make sure you have all the prerequisite tooling installed:
[Composer, installed globally. You should be able to type "composer install" rather than php ./composer.phar
, for instance.](https://handbook.cantilever.co/Composer-installed-globally-You-should-be-able-to-type-composer-install-rather-than-php-compo-004b84005e3b4be5b92cd9905c5f77b3)
Setting up a project to use Lando is relatively simple. Everything is configured from a .lando.yml
file. Follow these steps to get started:
In the root of your project create a .lando.yml
file
The minimum required fields to get a site is a name
and recipe
laravel
, WordPress = wordpress
Additional tooling can be added to the config file to provision the Docker box exactly as it would be on the server.
Example .lando.yml
file (non-Statamic sites)
name: projectname # Replace with the project name
recipe: laravel # For Craft sites, `wordpress` for WordPress sites
config:
php: "7.3" # Match what we are using on the production server
webroot: ./public # This can very depending on the project
services:
database:
run_as_root:
- /helpers/sql-import.sh /app/database.tgz # database.tgz is the local backup in the root directory
Example .lando.yml
file (Statamic sites)
name: projectname # Replace with the project name
recipe: lamp
config:
webroot: public
php: "8.2" # Match what we are using on the production server
services:
database: disabled
Every repo should have a secure note created in 1Password with the .env
contents. We should consider this the one source of truth for the .env file. This should be named [PROJECTNAME] - Local Env
(where PROJECTNAME is the name of the account/vault in 1Pass). After migrating a project to use Lando (or setting it up fresh), you will want to make sure that the database keys in the .env file match what Lando created.
Lando uses a simple naming scheme when creating the local database. Your local database will have the following credentials, using coversports
as the example:
DB_SERVER="database.coversports.internal"
- The coversports
here is name
you set in the .lando.yml
file.DB_PORT=3306
- Port 3306 is the default for Lando