Installing ImageMagick via SSH
Please use the “Print” function at the bottom of the page to create a PDF.
Valid for Managed Servers.
This article explains how to install the latest version of ImageMagick on your Managed Server.
Note
An older version of ImageMagick is preinstalled on Managed Servers. Installation is only necessary if you depend on the latest version.
ImageMagick is a library that enables, for example, PHP programs to manipulate graphics. ImageMagick can handle up to 100 different graphics formats, including .jpg, .png, .tif, etc.
Log in to your managed server via SSH.
Determine the latest released version, the “release tag”, of ImageMagick. The following command queries it directly from GitHub and stores it in the TAG variable:
TAG=$(curl -fsSL https://api.github.com/repos/ImageMagick/ImageMagick/releases/latest | grep -oP '"tag_name":\s*"\K[^"]+')
You can use the echo command to check which version was determined:
echo "$TAG"
The output will look something like this: 7.1.2-30
Download the source code of the determined version using the wget command:
wget -O ImageMagick.tar.gz "https://github.com/ImageMagick/ImageMagick/archive/refs/tags/${TAG}.tar.gz"
Extract the archive using the following command:
tar xfvz ImageMagick.tar.gz
Change to the directory containing the source code using the cd command. Since the directory name contains the version number, use the previously set TAG variable:
cd ImageMagick-${TAG}/
Use the pwd command to display the absolute path of the directory. This will be needed later for the installation; the output will look something like this:
/kunden/homepages/30/d339922114/htdocs/ImageMagick-7.1.2-30
Prepare the program for compilation using the ./configure command. Since you do not have access rights for the directory specified in the script, use the --prefix option to install ImageMagick in a subdirectory of your home directory. Here is an example of how to enter the ./configure command:
./configure --prefix=/kunden/homepages/30/d339922114/htdocs/ImageMagick
Enter the make command. If no error message appears, enter the make install command at the next prompt.
The installation is complete. You can now use the ./ImageMagick/bin/convert command in your scripts to access the most commonly used ImageMagick functions.
Note
The URL used above no longer contains a fixed version number. The command in step 2 automatically determines the latest released version each time it is run, so the article no longer needs to be updated manually when new ImageMagick releases are published. All subsequent steps consistently use the same version via the TAG variable.