cPanel Standard

How to install ImageMagick and Imagick on cPanel

By Angus Published 12 May 2026 Updated 14 May 2026 4 min read

ImageMagick is an image processing library used by PHP applications including WordPress and Magento for resizing, converting and manipulating images. The Imagick PHP extension connects your PHP stack to ImageMagick so applications can process images programmatically.

You will install ImageMagick and enable the Imagick extension on your cPanel server. Two methods are covered: EasyApache 4, which is the recommended approach for cPanel servers, and a manual SSH compilation method for advanced cases.

Before you begin

  • This guide is for VPS customers running their own cPanel server. If you are on a shared or reseller hosting plan, you will not have access to these features. Contact your hosting provider to request ImageMagick installation.
  • You need root SSH access and WHM access on your cPanel server.
  • EasyApache 4 must be installed. It is the default package manager on cPanel servers.
  • Note which PHP version your applications use. The Imagick extension must be enabled separately for each PHP version.

Method 1: Install via EasyApache 4 (recommended)

EasyApache 4 is the standard package manager on cPanel servers. Installing ImageMagick and Imagick through it ensures both packages integrate with your PHP stack and persist correctly through future cPanel updates.

Install the ImageMagick library

  1. Log in to WHM.
    Navigate to https://yourserver:2087, replacing yourserver with your server hostname or IP address.
  2. Open EasyApache 4.
    In the left sidebar, go to Software and click EasyApache 4.
  3. Customise your profile.
    Click Customize next to the currently provisioned profile.
  4. Add the ImageMagick package.
    In the search box, type imagemagick. Locate ea-imagemagick and toggle it on.
  5. Provision the profile.
    Click Review, then Provision. EasyApache 4 installs the package. This may take several minutes.

Enable the Imagick PHP extension

  1. Open MultiPHP Extensions Manager.
    In WHM, go to Software and click MultiPHP Extensions Manager.
  2. Select your PHP version.
    Use the PHP Version dropdown to select the version in use. Repeat for each PHP version your applications use.
  3. Enable Imagick.
    Search for imagick in the extensions list and tick the checkbox next to it.
  4. Save.
    Click Save. WHM writes the extension to php.ini for the selected version immediately.

The Imagick extension is now active. Skip to the verification section to confirm the installation.

Method 2: Install via SSH (manual compilation)

If you need to target a specific PHP version or EasyApache 4 is unavailable, you can compile Imagick from source via SSH. This uses EA-PHP’s own pecl and phpize binaries to ensure the extension links against the correct PHP build.

Connect to your server as root via SSH, then run the following commands, substituting ea-php83 for your target PHP version (for example, ea-php82 for PHP 8.2).

Download and extract the Imagick source:

/opt/cpanel/ea-php83/root/usr/bin/pecl download imagick
tar xvzf imagick-*.tgz
cd imagick-*

Set the pkg-config path so the build detects ImageMagick 7 correctly:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Prepare the build environment using EA-PHP’s phpize, then configure and compile:

/opt/cpanel/ea-php83/root/usr/bin/phpize
./configure   --with-imagick=/usr/local   --with-php-config=/opt/cpanel/ea-php83/root/usr/bin/php-config
make clean
make -j"$(nproc)"
make install

The compiled imagick.so is placed in /opt/cpanel/ea-php83/root/usr/lib64/php/modules/. Manually compiled extensions do not appear in MultiPHP Extensions Manager. To enable the extension, go to WHM → SoftwareMultiPHP INI Editor, switch to Editor Mode, select your PHP version, and add extension=imagick.so on a new line. Alternatively, add it directly to the relevant php.ini file.

Verify the installation

Run the following command via SSH to confirm Imagick is loaded for the PHP version you installed it against:

php -r "echo extension_loaded('imagick') ? 'Imagick loaded' : 'Imagick not found';"

If the output is Imagick loaded, the extension is working. If you see Imagick not found, check that the extension is enabled in MultiPHP Extensions Manager for the PHP version returned by php -v. You can also create a phpinfo file and search for imagick to confirm it appears in the extension list.

Wrapping up

You installed ImageMagick on your cPanel server and enabled the PHP Imagick extension. PHP applications on your server can now use Imagick for image resizing, format conversion and thumbnail generation.

Test the applications that depend on Imagick to confirm they work correctly after installation. If you need to change the PHP version for a domain, you can do so without affecting the Imagick extension settings. For a fresh server setup, see our guide on how to install cPanel.

Our VPS hosting plans give you root access and full control over server-level software, including EasyApache 4 package management.

Need more power?

Get scalable resources with our VPS hosting with root access and optional software.

Get VPS Hosting

Starting something new?

Perfect for websites and small businesses unlimited bandwidth with cPanel hosting.

Get cPanel Hosting