cPanel Standard

How to install ImageMagick and Imagick on cPanel

Applies to cPanel
By Angus Published 12 May 2026 Updated 8 October 2026 5 min read
Quick answer

In Web Host Manager (WHM), open EasyApache 4, click Customize on the current profile, enable ea-imagemagick, then click Review and Provision. In MultiPHP Extensions Manager, select each PHP version your sites use, tick imagick and click Save. Running a php -r check of extension_loaded('imagick') confirms the extension has loaded. The installation needs root access to your own cPanel server, so shared and reseller accounts cannot do it.

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.

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 → Software → MultiPHP 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.

Troubleshooting

imagick does not appear in Extensions Manager

If imagick is missing from the MultiPHP Extensions Manager after provisioning, it may have been compiled manually using PECL rather than installed as an EA4 package. Extensions compiled via PECL are not registered with EasyApache and will not appear in the Extensions Manager list.

To load a PECL-compiled imagick extension, use MultiPHP INI Editor instead:

  • In WHM, go to Software and open MultiPHP INI Editor.
  • Select Editor Mode and choose your PHP version from the dropdown.
  • Add the line extension=imagick.so to the configuration and click Save.

EasyApache provisioning fails

If EasyApache returns a dependency error during provisioning, clear the YUM package cache on the server and try again. Connect via SSH and run:

yum clean all

Return to EasyApache 4 and reprovision. If the error persists, check WHM notifications for a specific dependency conflict message.

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.

Plans and tools mentioned in this guide

VPS Hosting

Dedicated resources on a managed VPS.

From £9.99/mo

View VPS Hosting

Did this guide solve your problem?

Still stuck?

Our UK support team answers tickets and live chat every day. Send us the guide you were following and where it stopped working.

Open a ticket

Keep learning

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
Back to top