Installing and setting up Drupal 9 CMS system

botond published 2021/01/10, v - 16:43 time

Content

 

Introductory

Drupal is one PHP written for free CMS system, the latest major version of which is 9, released on June 2020, 3. From now on, Drupal 8.9 will only receive fix packs, and Drupal 8 - from which this page was made -  its support will also end on November 2021, 2, so I need to update this page to major version 9 by now at the latest. To get acquainted, I’m making a fresh Drupal 9 installation and looking around so I don’t have to rush at the last minute to see which module will be compatible with it, how much I need to vary the page, and so on. And if I’m already installing, I’ll make a little description of it as well to see if I can provide useful info to others. Before I created a guide for installing Drupal 8, in this description we will install the current release of major version 9.

 

 

system Requirements

Drupal systems require an HTTP server, such as a Apacheor Nginx, and a database server, for example MySQL / MariaDBand a PHP. For convenience, it doesn't hurt to have one upstairs phpMyAdmin is. Essentially any LAMP system run away. All that matters is that the Drupal system needs storage space, so we need to have the right amount of storage space on our server or leased storage space. But I'll talk about that a little later. Of course, it doesn't hurt to have enough memory and processors, as Drupal uses PHP quite massively.

You can also find it here on the site some server installation instructions, of which I am now the Debian 10 is the perfect server i will install Drupal 9. Of course, if someone installs on a rented storage space, they have nothing to do with them.

Az ISPConfig surface I created a simple web account, to which I connected a database and a shell user. So before you install on this server, this is what you need to get started:

Fresh ISPConfig web hosting on the server and shell user terminal associated with the account

This web account drupal9.vm I named it, which I also added to my hosts file so I can conveniently access it from the host machine's browser.

When you are ready and the right storage space is available, you can get started!

 

Obtain and unpack the Drupal 9 installation package

When installing a new system, always a get the latest installation package from the developer's official siteand install it. At the time of writing (2021-01-07) from the Drupal system a Version 9.1.2 is the latest, so I'm installing this now.

In a terminal, go to the web root directory of the user account and download the installation package to wget command:

cd /var/www/drupal9.vm/web/
wget https://ftp.drupal.org/files/projects/drupal-9.1.2.tar.gz

Unpack the tar command:

tar -xvzf drupal-9.1.2.tar.gz --strip=1
--strip = 1 switch to leave the creation of the first directory level in the package's internal directory structure, so it will immediately unpack to the current directory and not a drupal-9.1.2 to a subdirectory called (which was packaged by the creators) from which we could then copy the whole thing afterwards.
Of course, we only use this if we know for sure that the whole is packaged in an extra subdirectory - as with Drupal - that we don't want the system to extract.

After unpacking, we get about 18 files in our storage space with a total size of 000 Mb. These find and the du commands to check:

find . -type f | wc -l
du -sch .

Booking Drupal 9.1.2 after unpacking

Of course, this even includes the downloaded compressed installation file, which is about 17 Mb. This will be deleted at the very end when we are completely ready to install and the site is working properly.

I’m only describing all of this so that we can prepare for the needs of Drupal hosting so we can plan ahead for the needs of our future website. Drupal is perhaps the most robust CMS system, for example, that cannot be run on any cheap hosting. There are repositories where, for example, there is a file limit (Inode quota), so before you start the installation or before choosing a repository, find out about the properties of your repository - if you rent shared storage - so that you don't run into a low inode capability that you can't to place so many files. However, the size of files is no longer such a barrier even on cheaper storage sites, because almost everywhere 200-500 Mb is the limit for the lowest packages. However, keep in mind that this 158 Mb is the size of the freshly unpacked installation package, so let's take into account that during the installation and subsequent construction of the site, many more modules, language translations and themes (makeup) may be added to the site before it comes. the construction of content, ie the space required for the content we create (eg images, videos, other downloads). And of course there will even be database space, which is initially negligible in size, but after several years of use, it can increase significantly if we create content for the site on a regular basis. So if you’re planning for the longer term, don’t think about less than 1GB of storage.
If you’re looking for stable, reliable storage for your future Drupal site, you might want to check out, for example, Hosting.eu Drupal hosting packages, where you can get 1400 Gb of storage for about 5 HUF per month, which is optimized specifically for these CMS systems, and even has an automatic installer if you don't want to install Drupal yourself.

 

Alternative solution:
If we do not have SSH access to the given web hosting, we can also download the aforementioned installation file to our computer with our browser, where we unzip it, and then FTPwill be uploaded to our storage via But if we have SSH access, I definitely recommend the method described here, because uploading these 18 files when unpacked via FTP can take quite painful hours even with a faster internet connection, since FTP does not work very efficiently with many small files and directories.

 

 

Installing Drupal 9

Once you have extracted the system to the web root, all you have to do is upgrade it to the home page of the hosting in your browser and the Drupal 9.1.2 installer start panel will already load.

Select language

The first step is to select the language:

Install Drupal 9 - Select Language

It immediately offers us our own language, which the software downloads during installation. This will be the primary language of the page, so for example the language of the admin interface. If you want to build a multilingual solution, it must be configured after installation regardless of this language choice. Once you have selected the base language that is right for you, click the blue save button.

Select an installation profile

As you can see in this step, the language of the installer has already changed to Hungarian, where you have to select the installation method:

Install Drupal 9 - Select installation profile

You can choose from three options:

  • General: Commonly used installation mode with preset properties.
    It is advisable to choose this to build an average website. In this installation mode, you get a lot of pre-installed and configured modules, with which you get practically a finished page. Of course, there are still many, many settings waiting for us after installation so that we can shape our site to the way we want it.
  • Minimum: Build a custom website without pre-configured functionality. For advanced users.
    Here we have to set everything up for ourselves, even the most basic things to start using the site.
  • Tutorial: Install an exemplary Web site featuring key Drupal capabilities.
    With this profile, we can create demo pages instead.

I recommend the General option to everyone here, because that already gives us a finished page. Pre-installed and configured modules are useful, so the vast majority of them would be installed anyway if you chose the minimal option. So with the general mode, we can save a lot of time by setting them up.

Database setup

Here you need to specify the page database accesses in which the installer creates the necessary things:

Installing Drupal 9 - Configuring a Database

We must first select the type of our database. MySQL and MariaDB are the most common, and are used by most hosting providers. For example, Debian has migrated from major version 9 to the previously used MySQL to MariaDB. So this usually works on Debian servers. Of course, if you have an SQLite database engine, choose it.

Then enter the name of our database, the name of the database user and its password. I specified the ones I used to create the database on this repository.

Advanced options

If you click on the advanced options, a section will open with a few more options:

Drupal 9 Installation - Database Setup - Advanced Options

In a normal situation, it is not necessary to adjust them, but it may happen that we still have to touch them.

  • Server name: By default, the database server is on the same server as both the web server and PHP. Therefore, by default, the localhost is set. However, if, for example, you have a multi-server system where the database server is running on a separate server, you can enter its hostname here.
  • Port number: By default, you can connect to the database server on port 3306. But if we can access our databases on a different port, we can specify it here.
  • Table name prefix: If more than one application will share the same database, a unique prefix, such as drupal_, can help prevent conflicts. So, for example, if you already have, say, a WordPress website that uses the same database, it is highly recommended that you use a prefix so that you do not confuse the tables yourself and the systems do not have tables with the same name. because you can crash up on both websites.
    However, if we have the opportunity to do so, we prefer to use a separate database for each website, so backups and restores also cost less.

Website installation

 

 

We have nothing to do in this step, just wait until the progress bar reaches the end:

Install Drupal 9 - Install a website

Here, under the progress bar, write that you are installing 42 modules. So the modules that are part of the general installation profile are now added. So we no longer have to install and configure them one by one.

Update translations

We don't have to do anything in this step either, here you download and update the Hungarian translations:

Install Drupal 9 - Update Translations

Before the installation, I mentioned that many more modules and translations will be added to the site during the installation, which will also take up all the space. At the end of the installation, we will double-check the number of files and all the bookings so we can see how much fat the system has gained during the installation. Of course, here you turn on the "factory" modules, which are already included in the installation package, so you don't have to expect a big reservation here.

Website setup

We need to provide the main details of our website on the following form:

Drupal 9 Installation - Website Setup

  • Website name: Enter the name of our website. It will appear everywhere, including in the page header, browser title bar, and more.
  • Website email address: Automatic emails such as registration notifications will be sent from this address. To avoid being branded as spam, it's a good idea to provide an email address that ends with your site's domain name.
  • Website maintenance account username and password: This will be the primary account with full authority on the site. Later, you can use this account to create additional users who can be assigned different roles. Here, the system checks the strength of the entered password. As this is an administration account, it is strongly recommended that you enter the password strength in the green bar. It is recommended that you use a combination of lowercase, uppercase, numbers, and the special characters listed in your password to create a strong password, making your site secure. I did not use a complicated password here, as I am making this installation on the virtual server for demonstration purposes. I saved the admin password entered here to the /root/access.txt file on the virtual server so that all access will be available on the download server.

Scrolling a little further down are a few more things:

Drupal 9 Installation - Website Setup

  • Email CIM: This also belongs to the site maintenance account, so for example, the admin user receives notifications to this address, and so on.
  • Default country: During the operation of the page, the page adjusts the regional settings where necessary. For example, in modules, etc.
  • Default time zone: Here we set the time zone. Here, if your site's target audience may be in another country, you can set it up, but users can also set their own language and time zone in their account. The language is of course only if the translation is set to other languages. From a maintenance point of view, it is better to set your own time zone and where the website runs.
  • Automatically check for updates: This is left on so that the system notifies you when a newer version has been released for the base system or a module and we need to update.
  • Request email notifications: We also leave this on, as this will notify you by email about these updates. I'm turning it off here now because it doesn't make sense on the virtual machine.

When everything is set up, click Save and Continue at the bottom of the page

Update configuration translations

Finally, download some translations again:

Installing Drupal 9 - Update configuration translations

And with that, the installation is ready.

Repeat size check

 

 

We will look at the reservation again, as I promised:

Drupal 9 size after installation

Not much, but fattened up a bit on the system. About 100 new files and 2Mb growth, which is negligible. Of course, these "factory" modules are already included in the downloaded installation package, so you just had to turn them on. However, when we start building the site and download modules and themes (makeup) created by third-party developers, the size of the site will increase to a greater extent.

Even if we look at the database, we can see here that when the page is ready to start, the size of the database is 17,5 Mb:

Drupal 9 database size

Which, of course, will make you fat when building and using the site. For example, this site (Linux Portal) has a database size of 1,2 Gb, so in the long run you will definitely need some Gb of storage.

 

The home page

After the installation is complete, the page will reload and jump to the home page:

Drupal 9 home page

Here in the notification bar we get more information about the installation and congratulations on a successful installation.

Since we are logged in as admin, the Drupal admin menu bar appears above, where we can start drilling and carving the site.

 

Basic settings

After installation, we still need to make some small settings for the site to work without error. We will review these in this description, but managing the content of the page is no longer part of this tutorial.

The top admin menu bar Setting When you enter the menu, the system will immediately receive us with an error message:

Drupal 9 admin menu with an error message

If we follow the link in the red error panel, we'll be taken to the status report page to learn more about the error:

Drupal 9 Status Report Page

Here we can see the main parameters of the drupal system and also the data of our server configuration, such as PHP version, database version, etc. In addition, we receive information about a system error that draws our attention to a vulnerability to a type of attack, which, of course, can only pose a threat if used sharply.

 

 

Trusted storage settings

To resolve this issue, switch to a terminal and then starting from a web root go to the following directory:

cd sites/default/

Here, when we list the directory, we see three files:

Configure the Drupal 9 settings.php configuration file

Since I just missed the color terminal setting, so I entered the two switches manually to make the directory list clearer.

Of these, we need to edit settings.php, but since it does not have write access to it, we add the chmod command to modify its content:

chmod u+w settings.php

Then open the file dwarf, then search for "trusted_host_patterns", and after the comment section, add a few lines defining the domain availability of our site (with and without www):

nano settings.php
[...]
$settings['trusted_host_patterns'] = [
        '^www\.drupal9\.vm$',
        '^drupal9\.vm$',
];
[...]

So after editing this section should look like this (before and after with commented sections):

Configuring Drupal 9 - settings.php - configuring trusted_host_patterns

Of course, here too, everyone replaces their own domain name with drupal9.vm, as well as the escape characters before the dots and the special characters at the beginning and end of the line to make the regular expression regular.

Once you have made the change, save the file and remove the write permission from the settings.php file:

chmod u-w settings.php

If we don’t take it off, it also takes this as a bug for Drupal security reasons.

If we are done with this, just refresh a page on the status report page, and if we did everything right, the error message will disappear:

Drupal 9 Status Report - Flawless Status

Finally, we delete the downloaded installation package file at first because we no longer need it. From the web root, run the following command:

rm drupal-9.1.2.tar.gz

 

 

Conclusion

That would be the installation of Drupal 9, where it can be seen that it is almost identical to the installer of its predecessor. Moreover, the admin interface of the page has not changed either, apart from maybe a few translations. Once the installation is complete, you can start drilling, carving and building the site.

Drupal developers write that the base system of version 9 is not very different from the previous one, they just cleaned up unnecessary things from it and updated the external libraries to newer versions. So we hope that those who use Drupal 8 - like me - will be able to easily switch to 9.

I wish everyone a good Drupal!