1. Home
  2. cPanel
  3. How to install Drush in cPanel with CloudLinux and CageFS
  1. Home
  2. Drupal
  3. How to install Drush in cPanel with CloudLinux and CageFS

How to install Drush in cPanel with CloudLinux and CageFS

RedyHost customers who run Drupal websites in a cPanel hosting, ask us about getting Drush available in cPanel. Of course RedyHost cPanel hosting comes with Drush preinstalled and available inside the GageFS.

This page describes how to install Drush in a cPanel/WHM server with CloudLinux.

This page should be used by system admins who want to make Drush available to their customers in cPanel with CloudLinux/CageFS installed.

First, SSH to the cPanel/WHM server as the root user.

Next, run these commands to install drush:

cd
wget https://s3.amazonaws.com/files.drush.org/drush.phar
chmod +x drush.phar
mv drush.phar /usr/local/bin/drush

Now, as you have installed drush, let’s add it to the CageFS so that users could access it

vim /etc/cagefs/conf.d/drush.cfg

And add this content:

[drush]
comment=Allow drush to work on the server
paths=/usr/local/bin/drush

Next, update CageFS

cagefsctl --force-update

Test to see if it works, become a CageFS user.

su cagefsuser
vi ~/.drush/drush.ini [Add `disable_functions=` and save the file]
drush init

If your drush reports PHP errors related to PHP memory limit – check this article on How to change PHP Memory limit setting for drush in cPanel with CageFS and CloudLinux

To benefit from (benchmarked) fast cPanel hosting, including free as-is cPanel account migration,

sign up to our cPanel service now

Updated on 7 June, 2017

Was this article helpful?

Related Articles