Get started with Drupal
Drupal is a free, open-source content management system (CMS) known for handling structured content: many content types, detailed user roles and permissions, and multilingual sites. It suits larger or more complex websites, and it rewards some technical knowledge. This guide covers how modern Drupal is installed, the first things to set up and how to keep the site maintained.
How modern Drupal is built
Current Drupal versions are managed with Composer, a command-line tool for PHP that downloads an app and the libraries it depends on, and keeps them at matching versions. A Drupal site is set up as a Composer project: a folder with a composer.json file that lists Drupal core and every module and theme you add.
In the recommended project layout, the public files live in a subfolder called web, and other folders such as vendor sit beside it. Your domain's web root should point at the web folder, so code that should not be public stays out of reach. Ask your host how to change the web root (also called the document root) if it cannot be pointed at a subfolder.
Install Drupal
If your host offers a one-click installer for Drupal, it is the simplest start.
To install Drupal yourself with Composer:
-
Connect to your hosting with SSH, if your host provides it, or prepare the project on your own computer with Composer installed.
-
Create the project with the official recommended template:
composer create-project drupal/recommended-project example-site -
If you built it on your computer, upload the whole project folder over SFTP. See Upload files with SFTP.
-
Point the domain's web root at the project's
webfolder. -
Create a database and a database user in your hosting control panel.
-
Open your domain in a browser and follow the installer: choose a language and an installation profile, enter the database details and create the administrator account.
The installer writes your database details into web/sites/default/settings.php. After installing, make sure that file is not writable by the web server, as the installer advises. Never give files or folders full write access for everyone to "fix" an install problem.
First steps after installing
Check the status report
Open Reports > Status report in the admin area. It lists errors and warnings about your setup, such as missing PHP extensions, file permissions, cron and the trusted host patterns setting. Trusted host patterns, set in settings.php, tell Drupal which domain names it answers to, which protects against a type of attack that uses forged host names. Fix anything marked as an error before you build the site.
Add modules and themes
Drupal's add-ons are modules (features) and themes (the design). In a Composer project you add them with Composer, then switch them on in the admin area:
composer require drupal/example_module
Modules are enabled on the Extend page and themes on the Appearance page. Prefer projects on drupal.org that are covered by Drupal's security advisory policy and support your Drupal version, and uninstall modules you do not use.
Set up cron
Drupal runs regular housekeeping tasks, such as checking for updates and clearing old data, through cron. By default it can trigger these tasks during normal page visits. A real scheduled task on the server is more reliable. See Cron jobs.
Keep Drupal updated and backed up
Drupal publishes security releases for core and for covered modules. Watch for them in the admin area, or subscribe to security announcements on drupal.org.
- Back up the files and the database. See Backups and restores.
- Update the code with Composer, for example
composer update "drupal/core-*" --with-all-dependenciesfor core. - Run the database updates, either by visiting
/update.phpwhile logged in as an administrator or with a command-line tool such as Drush. - Clear the caches and check the site.
Try updates on a copy of the site first when you can, especially major version upgrades. Keep composer.json and composer.lock with your backups, because they record exactly which versions the site uses.
DomainPilot web hosting includes one-click installs for Drupal, and you can choose Drupal when you order so it is installed when your account is set up. A staging environment, a separate copy for testing changes, is included from the Business plan.
Where to get help
- The official documentation at drupal.org/docs covers installation, Composer and site building.
- Drupal's community forums and support channels are listed on drupal.org.
- Each module's page on drupal.org has an issue queue for bugs and questions about that module.
Busy sites with many logged-in users may need more resources than shared hosting provides. See Web hosting, VPS or cloud.