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.
A quick-start guide is included below.
For a complete reference, consult the following resources:
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.
Follow the Lando installation instructions.
To authorize Lando to communicate with Platform.sh, create an API token. Copy the value.
If your code isn’t present locally, retrieve your codebase with one of these methods:
Otherwise, access the directory with your project.
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.
- Create a new project based on the PHP template.
- Clone that project locally in one of these ways:
- In the project’s folder, run
lando init --recipe platformsh --source platformsh --platformsh-auth <API_TOKEN>.
- Follow the instructions provided by the interactive prompt.
Which project?step, select the project created in the first step.
init command generates the
.lando.yml file required to start Lando.
It also adds to your account a public SSH key.
To start your app and services, run
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.
- Import data and download files from your remote Platform.sh site.
- If you make changes in the Platform.sh configuration files during development, run
lando rebuildfor these to be taken into account in Lando.
- To keep your Lando image up-to-date, see how to update Lando.
- Make sure that the Platform.sh configuration files are present in your local repository.
- Check that your services are supported by Lando.
- Check caveats and known issues.
- Carefully check the output of the Lando commands you run to spot warnings and errors.
- Restart Lando in debug mode by running
lando restart -vvv.
- Check that you don’t face common issues, such as DNS rebinding protection.
- For more extensive troubleshooting, check the Lando documentation.
Access the global logs by running
To access specific logs:
lando listto get a list of the services you are using.
- Choose the one you’d like to inspect.
lando logs -s <SERVICE_TO_INSPECT>.
For more guidance regarding logs, check the Lando logs documentation
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.