This tutorial will show you how to install Drupal on an Ubuntu 18.04 computer. As of writing this article, the latest version of Drupal is 8.7.7.
1. Update your Ubuntu computer.
$ sudo apt update
2. Install the LAMP stack.
Refer to the tutorial How to Install Linux, Apache, MySQL, PHP (LAMP) Stack on Ubuntu 18.04.
3. Create a database and a database user for Drupal – and grant user permissions to access the database.
$ sudo mysql -u root -p mysql> CREATE DATABASE drupal_db; mysql> CREATE USER 'drupal_user'@'localhost' IDENTIFIED BY 'password'; mysql> GRANT ALL ON drupal_db.* TO 'drupal_user'@'localhost' IDENTIFIED BY 'password';
Remember the database name, database username and password as you will be needing them later.
4. Exit the database.
mysql> FLUSH PRIVILEGES; mysql> Exit;
5. Go to the Drupal website download page and copy the URL for the latest version of Drupal.
6. Download Drupal.
$ sudo wget https://www.drupal.org/download-latest/tar.gz
7. Extract the file.
tar -xzvf tar.gz
8. Copy the resulting folder to the directory /var/www/html/.
cp -R drupal-8.7.7 /var/www/html/
9. Rename the folder
mv /var/www/html/drupal-8.7.7 /var/www/html/drupal
10. Change the file permissions so Apache can access the folder.
$ sudo chown www-data:www-data -R /var/www/html/drupal
11. Go to your browser to start the site configuration.
Type this in the browser: localhost/drupal.
12. Choose a language.
Choose the language that you want to use for your website and then click the on the Save and continue button.
13. Select an installation profile
It is advisable to install the Standard version of Drupal as it comes with the commonly-used features. After selecting it, click on the Save and continue button.
14. Database configuration.
Type in the database name, database username and database password you used in creating the MySQL database Step 9. Leave Advanced Options as it is. Click on the Save and continue button.
15. Configure site.
Type in the site name, site email address, and other information needed for site maintenance and site settings. After which, click on the Save and continue button.
16. Congratulations! You have just completed the installation process and you are now logged in to your website’s Drupal dashboard.