In this article, we are going to shows how to Install ImageMagick on Ubuntu 20.04 | 18.04 . If you are interested to Install ImageMagick on Ubuntu then this post is ideal for you.
ImageMagick is a popular, free, open source and cross-platform software tool which is used for image manipulation. With the help of it, you can read and write images in different kind of formats (over 200) such as GIF, JPEG, PNG, Postscript, and TIFF.
You can use the ImageMagick to create, edit, compose, or convert digital images. It can resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects and many more.
For more details about mageMagick, please check its official page.
How to Install ImageMagick on Ubuntu
You can install ImageMagick on Ubuntu using below two methods:
- Install ImageMagick using the apt package repository
- Install ImageMagick using the source file
Method 1 : Installing ImageMagick using APT
Installing ImageMagick via apt package management tool from Ubuntu’s default repositories is the easiest way to install it. Using apt, you can install the latest stable version of ImageMagick in your Ubuntu system.
To install ImageMagick from apt, first update the default package index:
sudo apt updateAfter that, run the command below to install ImageMagick:
sudo apt install imagemagickWhen ask, Type ‘ y ‘ and click Enter key to allow additional disk space.
Once the installation is complete, verify the installation by running the command below:
convert logo: logo.gifThe command above will create a file named logo.gif in your Home directory. If the file is created in your Home directory that means the ImageMagick is successfully installed.
Method 2 : Install ImageMagick using the source file
You can also install the ImageMagick from the source file which will allow you to install the latest ImageMagick version. To install ImageMagick from the Source, simply follow below steps:
First of all, install the build-essentials tools to run ImageMagick:
sudo apt install build-essentialAfter that, download the source files of ImageMagick from its official website using the command below:
wget https://www.imagemagick.org/download/ImageMagick.tar.gzNext, extract the downloaded file using the command below:
tar xzvf ImageMagick.tar.gzAfter extract the file, change the director to the ImageMagick source directory by running the command below:
cd ImageMagick-7.1.0-0/After that, run the command below to compile and configure ImageMagick:
./configureNext, run the make command:
sudo apt install make
makeAfter compilation process, run the command below to install ImageMagick:
$ sudo make installAt last, you will need to configure the dynamic linker run-time bindings by running command below:
sudo ldconfig /usr/local/libTo verify the installation of ImageMagick, run the command below:
magick --versionoutput
Version : ImageMagick-7.1.0-0Install imagick PHP Extension
In the above steps or methods, you have successfully installed ImageMagick on your Ubuntu system. Next, if you want to install Imagick PHP extension for use it through PHP code, run the command below:
sudo apt install php-imagickNext, restart Apache by running command below:
sudo systemctl restart apache2
To verify the Installation, run the command below:
php -m | grep imagick
Output
imagick
That’s all
If you face any error and issue in above steps , please use comment box below to report.
If our tutorials helped you, please consider buying us a coffee. We appreciate your support!
Thank you for your support.



