Drupal is a free, web-based Open Source Content Management System (CMS) and Framework written in PHP and distributed under the GPL 2.0 (or later) licence.
According to W3Techs (2011-07-15), at least 2.3% of all websites worldwide are running with Drupal.
Drupal 8 is based on Symfony, a popular high performance PHP framework for web development.
Drupal was released for the first time in 2000 by Dries Buytaert. Since then it has been continuously developed and it is actively maintained by various contributors.
This guide is about installing Drupal 8 via Drupal Composer Template.
We are using PHP in the stable version
[isabell@stardust ~]$ uberspace tools version use php 7.2 Selected PHP version 7.2 The new configuration is adapted immediately. Patch updates will be applied automatically. [isabell@stardust ~]$ uberspace tools version show php Using 'PHP' version: '7.2' [isabell@stardust ~]$
You’ll need your MySQL credentials. Get them with
[isabell@stardust ~]$ my_print_defaults client --default-character-set=utf8mb4 --user=isabell --password=MySuperSecretPassword [isabell@stardust ~]$
Your website domain needs to be set up:
[isabell@stardust ~]$ uberspace web domain list isabell.example isabell.uber.space [isabell@stardust ~]$
You might replace target parameter
drupal with something more suitable.
cd into the directory above your document root
/var/www/virtual/$USER/ to run to
[isabell@stardust ~]$ cd /var/www/virtual/$USER/ [isabell@stardust isabell]$ composer create-project drupal-composer/drupal-project:8.x-dev drupal --no-interaction - Installing drupal-composer/drupal-project (8.x-dev bdaa8fd): Cloning bdaa8fd53b from cache Created project in drupal > DrupalProject\composer\ScriptHandler::checkComposerVersion Loading composer repositories with package information Updating dependencies (including require-dev) [...] > DrupalProject\composer\ScriptHandler::createRequiredFiles Created a sites/default/settings.php file with chmod 0666 Created a sites/default/files directory with chmod 0777 [isabell@stardust isabell]$
/var/www/virtual/$USER/drupal/web/.htaccess, search for
# RewriteBase / and remove the leading
# to activate this statement.
It is a very good time to initialise a repository within the
This step is optional but highly recommended ;-D
In order to make use of Drupal Composer Template’s drush, you will add the path of your Drupal Composer Template’s bin directory, which contains drush´s executable to the PATH environment variable. It will detect DRUPAL_ROOT.
Place the following statement to the startup file of your shell, e.g.
Create a configuration file for drush.
[isabell@stardust isabell]$ mkdir ~/.drush [isabell@stardust isabell]$ cp /var/www/virtual/$USER/drupal/vendor/drush/drush/examples/example.drush.yml ~/.drush/drush.yml
Add uri option to your drush configuration.
This is useful for some commands which generate urls, like
drush uli. Edit
~/.drush/drush.yml, search for
uri: and place the following statement below the matching line.
If you use more than one codebase, you will need install drush_launcher.
There are at least two different ways to install Drupal:
Open a browser and visit the URL of your domain. It is self-explanatory, for specific steps and screenshots checkout Running the Interactive Installer.
Trusted Host setting¶
For Drupals protection against HTTP HOST Header attacks,
you need to configure Trusted host security setting in
settings.php, which was introduced in Drupal 8.
Insert this configuration for the domains given above:
$settings['trusted_host_patterns'] = [ '^isabell\.example$', '^isabell\.uber\.space$', ];
For executing periodical tasks like e.g. updatíng the search index, purging old logs or checking for updates, you will need to create a cronjob.
Get your cron url for your site at
Administration > Configuration > System > Cron (/admin/config/system/cron).
We create a cronjob with above url which runs once a day:
[isabell@stardust isabell]$ crontab -e
4 0 * * * wget -O - -q -t 1 https://isabell.example/cron/CsUKMfKtaFI8P3CaFpWy6iMIJPjjAwnm-Svs6wXb_LSrxqLnlbv85qy5us0YSnK3iQpthKoIrQ
For Drupal core and contrib updates, configure
Reports > Available updates > Settings (/admin/reports/updates/settings) within your site
and subscribe Security advisories and public service announcements too!
In case of Core updates see the Updating Drupal Core section of Drupal Composer Template.
Updates of contributed modules work like this, e.g. for the
[isabell@stardust drupal]$ composer update drupal/geofield --with-dependencies
Tested with Drupal 8.7.9 and Uberspace 126.96.36.199Written by: Florian Latzel <https://netzaffe.de>