Installing Varbase with Lando
Lando is a great local development environment for Drupal and other applications that vastly simplifies local development and DevOps so you can focus on the application, rather than the environment.
Learn more about Lando on the official website: lando.dev
Lando is a development tool!
Note that while you can run Lando in production, it is highly discouraged, not recommended, and 100% not supported! DON'T DO IT!
Follow the steps below to setup Varbase with Lando.
  1. 1.
    Install Lando on your machine. Whether you use Linux, Mac, Windows, there's a package for you. Follow this guide to install Lando on your machine.
  2. 2.
    Create a new Varbase project using Composer, this will include a template file for .lando.yml, for information on how to integrate Lando on an existing project scroll to the bottom of this page.
    1
    composer create-project Vardot/varbase-project:~9 MY_VARBASE_PROJECT --no-dev --no-interaction
    Copied!
  3. 3.
    Edit the .lando.yml file and change the name value to your project's name.
    1
    cd MY_VARBASE_PROJECT
    2
    vim .lando.yml
    Copied!
  4. 4.
    Edit the settings.php file and add the following code to setup the database connection.
    1
    $databases['default']['default'] = [
    2
    'database' => 'drupal9',
    3
    'username' => 'drupal9',
    4
    'password' => 'drupal9',
    5
    'prefix' => '',
    6
    'host' => 'database',
    7
    'port' => '3306',
    8
    'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
    9
    'driver' => 'mysql',
    10
    ];
    11
    Copied!
  5. 5.
    Start the Lando project and enjoy.
    1
    lando start
    Copied!
For more information on the Lando file configuration, read more on https://docs.lando.dev/config/drupal9.html#getting-started
You can type lando info to know the MySQL database hostname, username, password, and all environment config you'll need.

Adding Lando to an existing Varbase project

  1. 1.
    Download .lando.yml from the Varbase project repo https://github.com/Vardot/varbase-project .
  2. 2.
    Proceed with steps 3, 4, and 5 mentioned above.
Last modified 5mo ago
Export as PDF
Copy link