How to set up Lando for Platform.sh on Windows 10

Image for post
Image for post
Lando local development environment for Platform.sh

Most programmers on Platform.sh use a Linux machine or a Mac. However, there are times when using Windows is the only option. So, I am going to show you how to set up your Windows 10 machine to run a Platform.sh project using Lando.

1. Get Lando

Download Lando from here

2. Enable Hyper-V your Windows 10 machine

You need to enable Hyper-V to make Docker work.
Warning: Lando only works on Windows 10 as it requires Hyper-V

3. Install Lando

If you do not have Docker or GIT make sure you leave them checked. Lando will install them for you

4. Enable your SSH keys

Copy your SSH keys into C:\Users\<user>\.ssh\
You need both the private key and public key present in the folder with this structure:
a. <name>
b. <name>.pub
Ex: id_rsa and id_rsa.pub

5. Enable password protected private key forwarding

Unless you work in a lab without internet you most likely have a password protected private key. You need to enable this manually in Lando. Here is how you do it:
a. Navigate to C:\Users\<user>\.lando
b. Create/Edit config.yml
c. Add loadPassphraseProtectedKeys: true in the file

6. Create a .lando.yml file in your project folder

Navigate to you Platform GIT repo and create a file called .lando.yml there then paste the recommended config from Platform.sh.

One thing to remember is to modify the name: app with a unique project name. if you leave this as is and you have multiple projects called app, Lando will affect all of them when you run a command.

7. Run lando start

Navigate to you project using either CMD or PowerShell and run lando start. This will start up your Lando server.

Note: You cannot use GITBash as it does not support TTY (I know, that sucks).

8. Do a lando platform build

In order to have you project set up inside the Lando environment you’ll need to run a lando platform build command in the project folder.

In case you are getting tar related errors (utime or archiving errors) add a --no-archive parameter so your command will look like this: lando platform build --no-archive.

9. Set up your Drupal 8 settings.local.php

In order to let your build connect to the lando docker machine, navigate to .platform/local/shared in your Platform.sh project folder and replace the contents of your settings.local.php with this:

10. Import your database from platform

11. Import your files

You need to run the file sync command like this:

Frequently Asked questions

  • I am getting “Drush is not installed” when I run lando drush status or similar.
    A: This is happening because the drupal8 recipe does not include drush by default. You will need to add this to your .lando.yml:
  • I am getting a big Docker “file not found error” or “could not access file”.
    A: If you are experiencing file system errors, it might be because the share between Docker and you host system is broken. Go to Docker -> Settings and remove then re-add your file shares.

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store