Use Lando for local development

Lando is a third-party local development tool for which several stacks are available (LAMP, LEMP, MEAN). Lando supports Platform.sh PHP projects out of the box through a plugin. The Lando Platform.sh plugin can read your Platform.sh configuration files and produce an equivalent local environment using Docker.

The Lando Platform.sh plugin is currently in beta and supports only PHP-based applications. Support for more languages is in progress.

Lando works with most services supported by Platform.sh except for Vault KMS and network storage. See a list of supported services.

A quick-start guide is included below.

For a complete reference, consult the following resources:

Before you begin 

You need hardware that meets the requirements.

Lando doesn’t automatically pull and set up environment variables that have been set in the Console. To use a build hook that requires environment variables, manually add them.

1. Install Lando 

Follow the Lando installation instructions.

2. Create an access token 

To authorize Lando to communicate with Platform.sh, create an API token. Copy the value.

3. Initialize Lando 

If your code isn’t present locally, retrieve your codebase with one of these methods:

Otherwise, access the directory with your project.

Run lando init --recipe platformsh --source cwd --platformsh-auth <API_TOKEN> and follow the instructions provided by the interactive prompt.

For a quicker start, create a project based on the Platform.sh PHP template. The template provides the most basic configuration for running a custom PHP project built with Composer. It also includes the required Platform.sh configuration files out of the box.

  1. Create a new project based on the PHP template.
  2. Clone that project locally in one of these ways:
  3. In the project’s folder, run lando init --recipe platformsh --source platformsh --platformsh-auth <API_TOKEN>.
  4. Follow the instructions provided by the interactive prompt. On the Which project? step, select the project created in the first step.

The init command generates the .lando.yml file required to start Lando. It also adds to your account a public SSH key.

4. Start Lando 

To start your app and services, run lando start.

5. Access your local app 

The last lines of the lando start command from the previous step contains URL to the different app and services. Access your app and services by opening the according URLs in your browser.

What’s next 

Troubleshooting 

Access logs 

Access the global logs by running lando logs.

To access specific logs:

  1. Run lando list to get a list of the services you are using.
  2. Choose the one you’d like to inspect.
  3. Run lando logs -s <SERVICE_TO_INSPECT>.

For more guidance regarding logs, check the Lando logs documentation

Untrusted SSL certificate 

When you access your local Lando sites through HTTPS, you get an error message in your browser. This is expected behavior.

Find out how to solve it in the Lando blog.

Something still wrong? 

Get in touch with Lando.