In this article, we will have explained the necessary steps to install and configure ImageMagick on Ubuntu 20.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with
sudo privileges. All the commands in this tutorial should be run as a non-root user.
ImageMagick is a popular multi-platform image manipulation tool. It can read and write images in a variety of formats like GIF, JPEG, PNG, Postscript, and TIFF. Currently, ImageMagick Studio LLC manages application development. Furthermore, it was first released on August 1, 1990.
Install ImageMagick on Ubuntu 20.04
Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.
sudo apt update sudo apt upgrade
Step 2. Installing ImageMagick on the Ubuntu system.
- Installing ImageMagick using
ImageMagick is available from the default Ubuntu repositories, and it can simply be installed by running the apt install command. with
sudo apt install imagemagick
- Install ImageMagick in Ubuntu using compiling source code:
Download the source code from the official website of ImageMagick:
tar -xvf ImageMagick.tar.gz cd ImageMagick-7.0.10-11/ ./configure make sudo make install
Next, configure dynamic linker run-time bindings:
sudo ldconfig /usr/local/lib
Step 3. Installing Imagick PHP Extension.
Now, you need to install the Imagick PHP extension, So that we can use it through PHP code:
sudo apt install php-imagick
Reload Apache service to enable PHP extension using the following command:
sudo systemctl restart apache2
Now verify that module is enabled properly:
$ php -m | grep imagick imagick
That’s all you need to do to install ImageMagick on Ubuntu 20.04 Focal Fossa. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.