Drupal Console is a command‑line tool designed to help with Drupal administration and development tasks. It complements Drush by providing additional scaffolding and debugging features. On ruachost.com, you can install Drupal Console to streamline site management.
Why Use Drupal Console?
-
Automates repetitive Drupal tasks.
-
Generates boilerplate code for modules, controllers, and services.
-
Provides debugging tools for routes, services, and events.
-
Simplifies site administration from the command line.
Steps to Install Drupal Console
Step 1: Ensure Drupal 8 or 9 Is Installed
-
Drupal Console only works with Drupal 8 and newer versions.
-
Verify your site is running Drupal 8 or 9 before proceeding.
Step 2: Connect via SSH
-
Log in to your ruachost.com Client Area.
-
Open an SSH session to your hosting account.
-
Navigate to your Drupal installation directory:
Bash cd ~/public_html/drupal
Step 3: Install Drupal Console
Run the following Composer command:
Bash
composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader
Step 4: Configure Alias for Easy Access
To run Drupal Console from any directory, add an alias:
Bash
echo 'alias drupal="/home/username/public_html/drupal_dir/vendor/bin/drupal"' >> ~/.bashrc
source ~/.bashrc
(Replace username with your hosting account username and drupal_dir with your Drupal directory.)
Step 5: Verify Installation
Run one of the following commands to confirm Drupal Console is working:
Bash
drupal site:status
drupal site:statistics
You should see information about your Drupal site.
Important Notes
-
Drupal Console does not replace Drush; they complement each other.
-
Always back up your site before running administrative commands.
-
Ensure Composer is installed and updated before starting.