Skip to content

Instantly share code, notes, and snippets.

@markf3lton
Last active July 21, 2020 20:39
Show Gist options
  • Save markf3lton/66c5cce6ccaaa69d8b0525ba16d1bd99 to your computer and use it in GitHub Desktop.
Save markf3lton/66c5cce6ccaaa69d8b0525ba16d1bd99 to your computer and use it in GitHub Desktop.
Set up a LAMP in about 15 minutes with Lando

Set up a LAMP in 10 minutes with Lando

Any Windows, Linux and Mac computer suitable for modern web development can run Lando. If this your first-time trial of this free, LAMP tool, it may take 30 mins or so just to install it -- but then, using it can be very fast, afterwards! The learning curve is not very steep.

Step 1: Install Lando following the docs https://docs.lando.dev/basics/installation.html

The following part should only take 15 minutes or so, it is s very fast.

Step 2: Create a directory wherever you keep projects on your system. Then cd into that directory, and run

lando init

This will launch the wizard. You should choose "remote git repo or archive" and of course paste the link to your Acquia repo.

When the wizard asks for the web-root, enter docroot.

Step 3: Check out the feature branch to use (e.g. develop-sf)

At this point, starting Drupal is as simple as typing lando start. But there are some configuration you may need to edit.

127.0.0.1 my-project.lndo.site 

Step 4: If you have not downloaded Acquia’s drush aliases, follow our docs to do so: https://docs.acquia.com/acquia-cloud/manage/ssh/drush/aliases/#downloading-drush-aliases

Step 5: To synchronize ACSF remote sites with your Lando, add drush aliases for the remote sites you want to work with. Read this doc for a quick how-to: https://gist.github.com/markf3lton/0f446eb0d953bb2eb12a8f10bdaabcef#file-acsf-to-local-md

Step 6: Mirror the host operating system’s drush aliases into your Lando development environment

IMPORTANT Edit the .lando.yml and add the last 2 lines shown here:

name: civiccms
recipe: drupal7
config:
  webroot: docroot
appserver:
    build:
      - mkdir -p ~/.drush
      - ln -sf /app/drush/civiccms.aliases.drushrc.php ~/.drush/civiccms.aliases.drushrc.php

You will have to rebuild, which only takes a few seconds, like this:

lando rebuild

Step 6: Sync your remote Acquia Site Factory site to your local using standard drush commands:

drush sql-sync @civiccms.01live.bartrussell @self

drush rsync @civiccms.01live.bartrussell:%files/ @self:%files

The site should be visible at the civiccms.lndo.site url as shown below.

@markf3lton
Copy link
Author

a-lando-site

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment