Installing Drupal

Step 1. Get your infrastructure installed and correctly configured

Drupal has some prerequisite infrastructure requirements. For Linux operating systems the necessary components are commonly referred to as a "LAMP"  stack (or if using Nginx as a web server a "LEMP" stack):

  • Linux OS

  • Apache2 web server (or Nginx)

  • MySQL database server (or MariaDB)

  • PHP

Following is a tutorial for installing a LAMP stack on Ubuntu18.04.  A web search may produce tutorials for other Linux Distributions and version numbers:

How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04

It is also very helpful to install phpMyAdmin This is a PHP browser based application to create, read, write and manage MySQL/MariaDB/PostgreSQL databases. 

How To Install and Secure phpMyAdmin on Ubuntu 22.04
Note:
Your specific OS and version instructions may be different

These components need to be installed  and configured with working user ID's, passwords and proper permissions.

Step 2.  Choose a Drupal installation method to install the Drupal code base

Once the underlying infrastructure components are installed there are a variety of methods to install Drupal.

  • Manual installation: download the desired distribution zip or tar file from Drupal.org and then extract and install the Drupal files to the desired path of your web server

  • Use Composer to install Drupal and its dependencies

  • Use Drush to install Drupal

  • Use Docker

  • Use a 1-click installation script on a Linux hosting service

  • Super Easy Super Quick 1-Click Method to Launch a Drupal Demo Site in a Browser:

    Our own WNCLUG member Dan Calloway found this very easy and quick way to  experience and try Drupal in a browser window.  It features  a  1-Click installation of a full Drupal demo site in a browser using a free GitPod or GitHub account.  Just visit this link: Set up a full Drupal dev environment in a browser

Although all of these methods will work, each method has its advantages and disadvantages.  In more recent Drupal distribution versions it seems that using Composer is the recommended method for installing Drupal, its core and contributed modules,  dependencies and for updating and upgrading the Drupal code base.  Composer is an application that installs, updates, upgrades and manages PHP applications and libraries.

If you wish to use Composer (highly recommended) you will need to download and install the Composer application. Although Composer is sometimes available in various Linux distribution software repositories, it is recommended you download it directly from getcomposer.org by following the installation instructions at getcomposer.org

Step 3. Create a MySQL/MariaDB Database for your Drupal project

Your Drupal website requires a database to hold its content and configuration. You can create a new empty database from a Linux terminal command line using MySQL commands. (see instructions below)   If you installed phpMyAdmin you can use that web app to create a new database. Using either method you will enter a name for the database, an authorized user id and a password as well as granting user privileges. (see instructions below - to be added)

Step 4. Create the Drupal "settings.php" file

The Drupal "settings.php" file is the main configuration file containing required and optional configuration settings for your Drupal site. After downloading the Drupal code base files and directories navigate to the /sites/default subdirectory. There you will find a file named default.settings.php.  Copy that file to a new file named "settings.php" (example command :  cp default.settings.php settings.php)

Then open settings.php with a text editor, e.g. nano or vi,  and look for the section for entering the database name, user id and password. Save the file and then temporarily change the user permissions by entering "chmod 777 settings.php".  After running the Drupal install.php script you will need to change the settings.php file to a more restrictve setting, e.g.  "chmod 644 settings.php".

Other helpful instructions and "How To"articles:

Preparing to install - Drupal

Get Drupal with Composer

Installing Drupal

How to Install and Configure Drupal on Ubuntu 20.04

MySQL on Linux (Beginners Tutorial)