Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Install ImageMagick on WHM and cPanel

This guide shows how to add ImageMagick and its PHP add-on, Imagick, to a server that uses WHM. It needs root access, so it suits VPS and dedicated server customers.

Website Management2 min read11 steps6 screenshots

What are ImageMagick and Imagick?

ImageMagick is a program that edits pictures. It can resize, crop, rotate and convert them. Imagick is a PHP extension. An extension is a small add-on that gives PHP a new skill. With Imagick, PHP code on your websites, such as WordPress plugins, can use ImageMagick. Many image and gallery plugins ask for it.

WHM is the control panel for the whole server. cPanel is the panel for one website account. As root you can use WHM.

Warning: Server changes can affect all sites on the machine. Take a backup or snapshot first.

Method 1: Use WHM

  1. Log in to WHM as root. The address is usually your server IP followed by :2087. Your welcome email has details.
    Screenshot: Log in to WHM as root. The address is usually your server IP followed by :2087 . Your welc
  2. In the search box on the left, type Module Installers and open it.
    Screenshot: In the search box on the left, type Module Installers and open it.
  3. Find PHP Pecl and click Manage.
    Screenshot: Find PHP Pecl and click Manage .
  4. Type imagick in the search box and click Go.
  5. Click Install next to it.
  6. Wait for the log to finish. Look for a success message.

Pecl is a store of PHP extensions.

Method 2: Use SSH

SSH is a safe way to type commands on a faraway server.

  1. Log in as root with SSH.
  2. Install the ImageMagick program and its development files:
    yum install ImageMagick ImageMagick-devel -y
    This command downloads ImageMagick. On AlmaLinux or newer systems, use dnf in place of yum.
  3. Install the PHP extension for the default cPanel PHP:
    /usr/local/bin/pecl install imagick
    Press Enter if it asks for a path.
  4. If you use EasyApache 4 with several PHP versions, install the matching package from WHM under EasyApache 4, or use Select PHP Version for an account. Package names often look like ea-php81-php-imagick.
  5. Restart the web server from WHM under Restart Services, or ask support.

Check that it works

php -m | grep imagick

This command lists PHP modules and picks out imagick. If you see the word, it is installed. You can also use a phpinfo() page, then delete it after.

If it fails

Quick recap

  • ImageMagick edits images. Imagick lets PHP use it.
  • You need root access.
  • Install through Module Installers, then PHP Pecl in WHM.
    Screenshot: Install through Module Installers , then PHP Pecl in WHM.
    Screenshot: Install through Module Installers , then PHP Pecl in WHM.
  • Or use SSH and EasyApache packages.
  • Back up first and verify with php -m.