Hi in this post I am going to explain to you how we can Install ImageMagick 7 on our Linux server. For this blog post, I am using Digital Ocean server, We can use ImageMagick tool to work with Image like crop, add watermark on image and lot’s more operation we can perform using ImageMagick and we also use ImageMagick tool with PHP.

So without wasting any time, we can follow below simple steps to configure ImageMagick on our server.

Step 1. Login to your Digital Ocean Server using terminal/putty.

Step 2. Once login successfully go to the HTML directory

cd /var/www/html

then we can download the latest release of ImageMagick tool using below command

sudo apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
sudo wget http://www.imagemagick.org/download/ImageMagick.tar.gz

Step 3. Unzip ImageMagick.tar.gz compressed file

sudo tar xzvf ImageMagick.tar.gz

Step 4. Move to ImageMagick folder in my case when I unzip the file

cd ImageMagick-7.0.8-41/

Step 5. Now run below commands one by one to configure ImageMagick

./configure
make
make install

Above command will install all previously compiled ImageMagick binaries on your system. Run ldconfig to link static libraries:

sudo ldconfig /usr/local/lib

Step 6. Move to HTML directory and run below command to check the version of ImageMagick

identify -version

Step 7. Now we can install ImageMagick PHP extension you can run below command to do that

sudo apt install php7.2-imagick
service php7.2-fpm restart

Now you are ready to use ImageMagick tool in your PHP application to check ImageMagick extension is installed check phpinfo file.

Hope this post help you to install ImageMagick in your server.