Installing Drupal Console
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?
Section titled “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
Section titled “Steps to Install Drupal Console”Step 1: Ensure Drupal 8 or 9 Is Installed
Section titled “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
Section titled “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:
Terminal window cd ~/public_html/drupal
Step 3: Install Drupal Console
Section titled “Step 3: Install Drupal Console”Run the following Composer command:
composer require drupal/console:~1.0 --prefer-dist --optimize-autoloaderStep 4: Configure Alias for Easy Access
Section titled “Step 4: Configure Alias for Easy Access”To run Drupal Console from any directory, add an alias:
echo 'alias drupal="/home/username/public_html/drupal_dir/vendor/bin/drupal"' >> ~/.bashrcsource ~/.bashrc(Replace username with your hosting account username and drupal_dir with your Drupal directory.)
Step 5: Verify Installation
Section titled “Step 5: Verify Installation”Run one of the following commands to confirm Drupal Console is working:
drupal site:statusdrupal site:statisticsYou should see information about your Drupal site.
Important Notes
Section titled “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.