Install drupal 9 using composer with lando

Drupal is a free and open source content-management framework written in PHP using Symfony framework and distributed under the GNU General Public License. Worlwise approximate 2.3% web sites devloped using Drupal – it’s ranging from personal blogs to corporate, political, and government sites.

Table of content

  1. Create & Download project using composer
  2. Switch to created project
  3. Create codebase (.lando.yml) file
  4. start installation of project (using command: lando start)
  5. configured website
  6. show drupal & php version

Some websites list developed in drupal

  • IGNOU – Indira Gandhi National Open University is world biggest open university.
  • Univercity of OXFORD – The University of Oxford is a collegiate research university in Oxford, Oxfordshire, England. There is evidence of teaching as early as 1096.
  • Tesla is one of the world’s biggest for automobiles and clean energy company.
  • India GovernmentThe Government of India, often abbreviated as GoI, is the union government created by the constitution of India as the legislative, executive and judicial authority of the union of twenty eight states and eight union territories of a constitutionally democratic republic.
  • NIIT – National Institute of Information Technology – a large private institution world wise.

Note: Make sure lando installed on your machine.

Quick Installation

Note: Please run command below step by step for successful quick installation. or can go in details, below in this blog.

lando composer create-project drupal/recommended-project:^9@dev headlessdrupal
       // press 'y' , when screen is asking for remote existing vcs ( .git, .svn.. ) history

cd headlessdrupal

lando init --source cwd --webroot web --name headlessdrupal --recipe drupal9 --option php=7.4

lando start

     //Go to browser and hit: http://headlessdrupal.lndo.site/ and configure your website make sure database user: drupal9 , password: drupal9 and database name is: drupal9 and host name is database.

Related: Install drupal 9 using composer without lando

1. Create & Download project using composer

lando composer create-project drupal/recommended-project:^9@dev headlessdrupal

Note: Screen asking for remove existing VCS ( .git, .svn.. ) history [Y , n] : Please press y and hit return

remove existing VCS
Please press y and hit return/enter

2. Switch to created project

cd headlessdrupal
cd headlessdrupal
Switch to created project : cd headlessdrupal

Note: there is no .lando.yml file, we will create in next step

show all files
show all files

3. Create codebase (.lando.yml) file

Note: we can create it by 2 ways. Below are the steps – (choose any one at a time).

3. 1 . choosing codebase

lando init

Note: current working directory and hit return/enter.

current working directory
current working directory

Note: Select drupal9 and hit return/enter.

recipe:drupal9
drupal9

Note: write web and hit return/enter

Webroot: web
Webroot: web

Note: write project name headlessdrupal and hit return/enter.

appname: headlessdrupal
headlessdrupal
App initialised & .lando.yml file created
App initialised & .lando.yml file created

3.2. using direct command

lando init --source cwd --webroot web --name headlessdrupal --recipe drupal9 --option php=7.4
App initialised
App initialised & .lando.yml file created

4. Start installation of project

lando start
lando start
project setup successfully

5. configured website

Note: Go to browser and hit: http://headlessdrupal.lndo.site/

Note: Choose language: English is default, and click on Save and continue.

Choose language: English is default
Choose language: English

Note: make sure it’s checked on Standard and click on Save and continue.

Choose profile
Choose profile

Note: Please enter database user: drupal9 , password: drupal9 and database name is: drupal9 and host name is database. And click on save and continue. (for more details hit lando info in terminal)

Set up database
Set up database

Note: configured your websites accordingly, and click on save and continue.

configure your websites
Drupal sites has been install and loggedin
Drupal sites has been install and loggedin

6. show drupal & php version

Note: go to Reports-> Status report (http://headlessdrupal.lndo.site/admin/reports/status). Latest Drupal and PHP version as on Mar’2021.

Latest Drupal and PHP version
Latest Drupal and PHP version

Pradip Mehta

I am a well-organized professional in Drupal Development and PHP web development with strong script handling knowledge or automation process with PHP. I have advanced computer skills and am a proficient multitasker.

Leave a Reply