Skip to content
Related Articles

Related Articles

How to Install Imagick for PHP on AWS EC2?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 31 Jan, 2022

AWS or Amazon web services is a cloud service platform. It provides on-demand computational services, databases, storage space, and many more services. EC2 or Elastic Compute Cloud is a scalable computing service launched on the AWS cloud platform. Or in other words, EC2 is a virtual computer on which we can perform all our tasks and we have the authority to configure, launch or even dissipate this virtual computer. 

Imagick is a PHP ImageMagick extension. It is used to create and modify images using the ImageMagick API. It is used to read, write, and convert the images in any formats including, EXR, GIF, JPEG, PDF, PNG, PhotoCD, TIFF, etc. In this article, we will learn how to install Imagick for PHP in Linux. In this article, we will learn how to install Imagick for PHP on AWS EC2.


  1. AWS account.
  2. EC2 Instance.
  3. User with privileges to create an instance. 
  4. PHP should already be installed.

Installing Imagick for PHP on AWS EC2 

Follow the steps below to install Imagick for PHP on AWS EC2:

Step 1: Create an AWS Elastic Cloud Compute instance. 

Step 2: Start the EC2 instance that you have already created above step.


Step 3: Click on Connect button to connect the EC2 instance. 


Step 4: A prompt window will pop up after connecting.


Step 5: Check if PHP is already installed or not on our AWS EC2.

php –version


Step 6: If PHP is not installed on your AWS EC2, then install PHP, to do so visit How-To-Install-PHP-On-AWS.

Step 7: At first update, Ubuntu packages by using the following command.

sudo apt update


Step 8: Install Imagick for PHP on AWS EC2 using the following command.

sudo apt install php-imagick


Step 9: A prompt will appear asking you for confirmation, press ‘y’ to confirm.

Step 10: Wait for the installation process to end.


Step 11: We have successfully installed Imagick for PHP on AWS EC2, to check if Imagick is successfully installed or not, verify using the following command.

php -m | grep imagick


This is how we install Imagick for PHP on our EC2 instance using EC2 Instance Connect and if you also use a free tier account, make sure you delete all the resources you have used before logging out. 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!