How to Install ImageMagick and Imagick PHP extension in Ubuntu ?

The Imagick function is used to create and modify images using the ImageMagick API. The ImageMagick is the software suite to create edit and modify the compose bitmap images. This functions read, write and converts images in many formats including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF.

Requirements: PHP 5.1.3 and ImageMagick 6.2.4 versions required to install ImageMagick.

The installation process of ImageMagick (Imagick) on Ubuntu: There are some steps to install ImageMagick and Imagick PHP extension on Ubuntu 16.04, 18.04 and above versions which are listed below:

  • Install Apache Server: If apache server is not installed in your system then first install the apache2 server.
  • Make Superuser: Open terminal and use following command to make yourself superuser.
    sudo su

  • Install Required Packages: Use the following command to Install the required packages of ImageMagick and Imagick PHP extension.
    $ sudo apt install php php-common gcc

  • Install ImageMagick extension: Now install the ImageMagick PHP extension by using the following command.
    $ sudo apt install imagemagick

  • Install Imagick extension: After completion of ImageMagick package, the Imagick PHP extension will install.
    $ sudo apt install php-imagick

  • Restart Apache Server: Restart the apache server by using the following command.
    $ sudo systemctl restart apache2

  • Verify the Imagick extension: The Imagick extension can be verified by using the following command.
    $ php -m | grep imagick

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.