How to Install ImageMagick on Debian 13, 12 and 11

Install ImageMagick on Debian 13, 12, and 11 with APT or source. Covers convert, magick, headers, and removal.

UpdatedPublished AuthorJoshua JamesRead time7 minGuide typeDebian

Batch image work gets tedious fast when every resize, format conversion, or watermark needs a graphical editor. To install ImageMagick on Debian, use the imagemagick package from the default APT sources unless you specifically need the current upstream source build. Debian 13 (trixie) installs ImageMagick 7 with both magick and convert, while Debian 12 (bookworm) and Debian 11 (bullseye) install ImageMagick 6, where convert remains the portable command.

The APT method is the best default because Debian handles security updates and package integration. Source compilation is useful for custom delegates, module builds, or the newest upstream ImageMagick release, but it also makes updates and removal your responsibility. PHP users should note that php-imagick is a separate extension; the Install PHP Imagick on Debian guide covers that stack-specific path.

Install ImageMagick on Debian

Install the default Debian package first unless you already know you need a source build. The package name is imagemagick, not magick.

Update Debian Package Index

Refresh APT metadata before installing packages from Debian’s default repositories:

sudo apt update

These commands use sudo for package-management tasks. If your account does not have sudo access yet, add it with the guide to add a user to sudoers on Debian, or run the commands from a root shell.

Install ImageMagick Package

Install ImageMagick with APT:

sudo apt install imagemagick

Verify ImageMagick Version

Check the installed command-line tools with convert, which works across Debian 13, 12, and 11:

convert --version

Expected output on Debian 13 (trixie):

Version: ImageMagick 7.1.1-43 Q16 x86_64 22550 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png raw tiff webp wmf x xml zlib zstd
Compiler: gcc (14.2)

Debian 12 (bookworm) and Debian 11 (bullseye) report the ImageMagick 6.9.11 series from their default security-updated package sources. Those releases do not install the magick wrapper unless you build or install ImageMagick 7 separately.

On Debian 13, you can also check the ImageMagick 7 wrapper directly:

magick --version

Use convert when you want commands that work on Debian 13, 12, and 11. Use magick when you are writing specifically for ImageMagick 7, such as Debian 13’s default package or a current source build.

If a script needs the absolute ImageMagick path, check the active binaries directly:

command -v convert
command -v magick || true

Expected output on Debian 13 (trixie):

/usr/bin/convert
/usr/bin/magick

Debian 12 (bookworm) and Debian 11 (bullseye) show /usr/bin/convert only. The source build later in this guide installs its ImageMagick 7 binary as /usr/local/bin/magick.

Install ImageMagick Development Headers on Debian

Skip this section for normal command-line image conversion. Install the development package only when compiling software against ImageMagick libraries or when another package asks for MagickWand development files.

sudo apt install libmagickwand-dev pkg-config

On Debian 12 and Debian 11, libmagickwand-dev follows the ImageMagick 6 development package family, so related packages such as imagemagick-6-common and the /etc/ImageMagick-6/policy.xml path are expected. Debian 13 uses the ImageMagick 7 development package family instead.

Debian 13, 12, and 11 use pkg-config metadata for MagickWand builds. Check the installed development metadata with:

pkg-config --modversion MagickWand

Expected output on Debian 13 (trixie):

7.1.1

Debian 12 (bookworm) and Debian 11 (bullseye) report 6.9.11. If an older build script asks for magick-config, check for it explicitly:

command -v magick-config || echo "magick-config is not installed on current Debian releases"
magick-config is not installed on current Debian releases

For most current Debian builds, update the project to use pkg-config --cflags --libs MagickWand instead of searching for a legacy magick-config helper.

Compare ImageMagick Methods on Debian

The default package is enough for most systems. Use source only when the packaged branch or delegate set does not meet your requirement.

MethodVersion and CommandsUpdate PathBest For
APT packageDebian package sources. Debian 13 (trixie) ships ImageMagick 7.1.1; Debian 12 (bookworm) and Debian 11 (bullseye) ship the 6.9.11 series. Use convert across all three releases.Updated with normal APT security and package upgrades.Most users, servers, scripts, and production systems.
Source buildCurrent upstream release from the ImageMagick GitHub releases. The clone command resolves the newest numeric release tag when you run it.Manual rebuild and reinstall from the source tree.Advanced users who need current upstream behavior, custom delegates, or module builds.

Install ImageMagick from Source on Debian

Source builds follow ImageMagick’s official source installation workflow: clone a release tag, configure, build, install, and refresh the dynamic linker. This workflow keeps the source tree in $HOME/src/imagemagick-build, uses a separate build subdirectory for generated files, and installs binaries under /usr/local.

APT and source builds can coexist, but /usr/local/bin often appears before /usr/bin in PATH. If you only want one ImageMagick command set, remove the APT package before installing from source.

Install Source Build Dependencies

Install the compiler, Git, module support, and common image delegate development packages. Do not install libmagickwand-dev for this source-build path; that package is for compiling other software against Debian’s packaged ImageMagick libraries.

sudo apt install git build-essential pkg-config libtool libltdl-dev libjpeg-dev libpng-dev libtiff-dev libgif-dev libfreetype-dev liblcms2-dev libxml2-dev libwebp-dev libheif-dev libraw-dev ghostscript libgs-dev

The dependency list includes libltdl-dev because the source build enables ImageMagick module support with --with-modules. The separate libmagickwand-dev package remains useful only when another project needs Debian’s MagickWand headers. If you want more background on Git before cloning the source tree, the Install Git on Debian guide covers the package separately.

Clone the Latest ImageMagick Release

Create a source directory, detect the latest ImageMagick release tag, and clone that tag from the upstream repository:

mkdir -p "$HOME/src"
cd "$HOME/src"
LATEST_TAG="$(git ls-remote --refs --tags https://github.com/ImageMagick/ImageMagick.git | awk -F/ '/refs\/tags\/[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$/ {print $3}' | sort -V | tail -n 1)"
printf 'Latest ImageMagick tag: %s\n' "$LATEST_TAG"
git clone --depth 1 --branch "$LATEST_TAG" https://github.com/ImageMagick/ImageMagick.git imagemagick-build
cd imagemagick-build

The printed release tag changes over time. Compare it with the latest tag on the ImageMagick releases page if you need to audit the exact source before building.

Configure ImageMagick Source Build

Configure ImageMagick with module support and without PerlMagick. The separate build directory keeps generated files out of the Git checkout, which makes later update checks cleaner. The --without-perl flag keeps this source workflow focused on the command-line tools and avoids installing Perl module files outside the main ImageMagick prefix.

mkdir -p build
cd build
../configure --with-modules --without-perl

Relevant configuration output should show that module support is enabled:

Module support      --with-modules=yes          yes

Compile and Install Source-Built ImageMagick

Compile with one job per CPU core, install the build, and refresh the dynamic linker cache so Debian can locate the new libraries under /usr/local/lib:

make -j"$(nproc)"
sudo make install
sudo ldconfig /usr/local/lib

Verify Source-Built ImageMagick

Check the source-built binary directly from /usr/local/bin:

/usr/local/bin/magick --version
/usr/local/bin/magick -list configure | grep -E '^(FEATURES|DELEGATES)'

Your version line will change as ImageMagick publishes newer tags. The important checks are that the binary runs from /usr/local/bin, the feature list includes Modules, and the delegate list includes the formats you need.

Run ImageMagick Command Examples on Debian

These examples use ImageMagick’s built-in logo: image, so you can test commands without downloading sample files. They use convert for compatibility with Debian 13, 12, and 11.

Convert an Image Format with ImageMagick

Create a PNG file from ImageMagick’s built-in logo image:

convert logo: logo.png

Create an ImageMagick Thumbnail

Generate a 200×200 thumbnail while stripping unnecessary metadata:

convert logo.png -thumbnail 200x200 logo-thumb.png

Resize an Image with ImageMagick

Resize an image to fit within 800×600 pixels while preserving the original aspect ratio:

convert logo.png -resize 800x600 logo-resized.png

Add Text to an Image with ImageMagick

Create a simple banner with centered text. Debian normally includes the DejaVu font family, so DejaVu-Sans is a safer example than assuming Arial exists:

convert -size 800x200 xc:navy -font DejaVu-Sans -pointsize 36 -fill white -gravity center -annotate +0+0 "Debian ImageMagick" banner.png

Apply an ImageMagick Sepia Effect

Apply a sepia tone effect at 80 percent intensity:

convert logo.png -sepia-tone 80% logo-sepia.png

Blur an Image with ImageMagick

Blur an image for privacy, background treatment, or draft mockups. The 0x8 value uses an automatic radius with sigma set to 8:

convert logo.png -blur 0x8 logo-blur.png

Crop an Image with ImageMagick

Extract a 200×200 pixel region starting 50 pixels from the left and 50 pixels from the top:

convert logo.png -crop 200x200+50+50 logo-crop.png

Troubleshoot ImageMagick on Debian

Most ImageMagick issues on Debian come from command-name differences, source-built library paths, or missing delegate libraries.

magick Command Not Found on Debian

Debian 12 (bookworm) and Debian 11 (bullseye) install ImageMagick 6 from the default repositories, so this error is expected when you try to run magick:

bash: magick: command not found

Use convert on those releases, or use the source-build method if you specifically need ImageMagick 7:

convert --version

Shared Library Error After Source Install

Source installs place libraries under /usr/local/lib. If the dynamic linker cache was not refreshed, magick can fail with a shared-library error similar to this:

magick: error while loading shared libraries: libMagickCore-7.Q16HDRI.so.10: cannot open shared object file: No such file or directory

Confirm the libraries exist, then refresh the linker cache:

ls /usr/local/lib/libMagick*
sudo ldconfig /usr/local/lib
/usr/local/bin/magick --version

Missing Format Support in ImageMagick

When a format fails with a “no decode delegate” or “no encode delegate” message, check which delegates the active ImageMagick command can see:

convert -list configure | grep DELEGATES

Relevant output should list the formats you expect, such as JPEG, PNG, TIFF, WebP, HEIC, RAW, FreeType, and Ghostscript support:

DELEGATES = bzlib djvu fontconfig freetype heic jbig jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raw tiff webp wmf x xml zlib zstd

If a source build missed a delegate, install the matching development package and rebuild. For example, WebP, HEIC, RAW, and Ghostscript support use these packages:

sudo apt install libwebp-dev libheif-dev libraw-dev ghostscript libgs-dev
cd "$HOME/src/imagemagick-build/build"
../configure --with-modules --without-perl
make -j"$(nproc)"
sudo make install
sudo ldconfig /usr/local/lib

Find ImageMagick policy.xml on Debian

ImageMagick’s policy.xml file controls security policies for some operations, including PDF and Ghostscript-related behavior. Locate the Debian package-managed policy file with:

dpkg -L imagemagick-6-common imagemagick-7-common 2>/dev/null | grep '/policy.xml$'

Expected output on Debian 13 (trixie):

/etc/ImageMagick-7/policy.xml

Debian 12 (bookworm) and Debian 11 (bullseye) use /etc/ImageMagick-6/policy.xml. Make a backup before editing this file because overly broad policy changes can weaken ImageMagick’s default safety restrictions.

Update Source-Compiled ImageMagick

If you built from source, create a repeatable update command in /usr/local/bin. The sudo tee command writes the script to a root-owned path; plain shell redirection would not have permission to create that file. The final chmod command makes the script executable; the chmod command in Linux guide covers permission basics separately.

helper_path=/usr/local/bin/update-imagemagick-source
helper_marker="# LinuxCapable: ImageMagick source updater"

if sudo test -e "$helper_path" && ! sudo grep -qF "$helper_marker" "$helper_path"; then
    printf '%s already exists and was not created by this workflow.\n' "$helper_path" >&2
    printf 'Move that file or choose a different helper name before continuing.\n' >&2
else
cat <<'EOF' | sudo tee "$helper_path" > /dev/null
#!/usr/bin/env bash
# LinuxCapable: ImageMagick source updater
set -euo pipefail

SOURCE_DIR="${SOURCE_DIR:-$HOME/src/imagemagick-build}"
BUILD_DIR="${BUILD_DIR:-$SOURCE_DIR/build}"

if [ ! -d "$SOURCE_DIR/.git" ]; then
    echo "Source directory not found: $SOURCE_DIR"
    echo "Run the source installation steps first, or set SOURCE_DIR=/path/to/imagemagick-build."
    exit 1
fi

cd "$SOURCE_DIR"

CURRENT_TAG="$(git describe --tags --exact-match 2>/dev/null || git describe --tags --abbrev=0 2>/dev/null || echo unknown)"
LATEST_TAG="$(git ls-remote --refs --tags https://github.com/ImageMagick/ImageMagick.git | awk -F/ '/refs\/tags\/[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$/ {print $3}' | sort -V | tail -n 1)"

echo "Current tag: $CURRENT_TAG"
echo "Latest tag:  $LATEST_TAG"

if [ -z "$LATEST_TAG" ]; then
    echo "No ImageMagick release tags found."
    exit 1
fi

if [ "$CURRENT_TAG" = "$LATEST_TAG" ]; then
    echo "ImageMagick source tree is already on the latest tag."
    exit 0
fi

if ! git diff --quiet || ! git diff --cached --quiet; then
    echo "Source directory has uncommitted changes. Review or stash them before updating."
    exit 1
fi

if [ -f "$BUILD_DIR/Makefile" ]; then
    (cd "$BUILD_DIR" && sudo make uninstall) || true
    (cd "$BUILD_DIR" && make distclean) || true
fi

git fetch --depth 1 --force origin "refs/tags/$LATEST_TAG:refs/tags/$LATEST_TAG"
git checkout --quiet "$LATEST_TAG"
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
../configure --with-modules --without-perl
make -j"$(nproc)"
sudo make install
sudo ldconfig /usr/local/lib
/usr/local/bin/magick --version
EOF
sudo chmod 0755 "$helper_path"
fi

Confirm the helper resolves from /usr/local/bin before relying on the short command name:

command -v update-imagemagick-source
/usr/local/bin/update-imagemagick-source

Run the updater manually when you want to check for a newer ImageMagick tag:

update-imagemagick-source

A no-op run ends with this line when the source tree already matches the newest release tag:

ImageMagick source tree is already on the latest tag.

Run source updates manually instead of scheduling them with cron. Source builds can fail because of changed dependencies, compiler errors, or network problems, and you want to see that output before replacing a working install.

Remove ImageMagick from Debian

Use the removal path that matches the installation method you used.

Remove APT-Installed ImageMagick

Remove the metapackage and whichever versioned ImageMagick command package is installed. The package list covers imagemagick-7.q16 on Debian 13 and imagemagick-6.q16 on Debian 12 and 11 without asking APT to interpret a package pattern:

mapfile -t imagemagick_packages < <(dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' imagemagick imagemagick-6.q16 imagemagick-7.q16 2>/dev/null | awk '$1 ~ /^ii/ {print $2}')
if [ "${#imagemagick_packages[@]}" -gt 0 ]; then
    sudo apt remove "${imagemagick_packages[@]}"
else
    echo "No ImageMagick command packages are installed."
fi

If APT suggests sudo apt autoremove afterward, review the package list before confirming. On reused systems, autoremove can include unrelated old kernels or packages from earlier work, not only ImageMagick dependencies.

Verify that no ImageMagick command package remains installed:

dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' imagemagick imagemagick-6.q16 imagemagick-7.q16 2>/dev/null | grep '^ii' || echo "ImageMagick command packages are not installed"
ImageMagick command packages are not installed

Remove Source-Compiled ImageMagick

Use ImageMagick’s upstream make uninstall target from the same source tree and configuration that installed it:

if cd "$HOME/src/imagemagick-build/build"; then
    sudo make uninstall
    if sudo test -f /usr/local/bin/update-imagemagick-source && sudo grep -qF "# LinuxCapable: ImageMagick source updater" /usr/local/bin/update-imagemagick-source; then
        sudo rm -f /usr/local/bin/update-imagemagick-source
    fi
    sudo ldconfig
else
    printf 'Build directory not found: %s\n' "$HOME/src/imagemagick-build/build" >&2
fi

The next command permanently deletes the source tree under $HOME/src/imagemagick-build. Keep it if you made local changes or want to inspect the build logs later.

rm -rf -- "$HOME/src/imagemagick-build"

Confirm the source-built binary is gone. If Debian’s APT package is still installed, /usr/bin/convert may still exist, but /usr/local/bin/magick should not:

test -x /usr/local/bin/magick && echo "source build still present" || echo "source build removed"
source build removed

Conclusion

ImageMagick is ready on Debian for shell-based conversion, resizing, thumbnail generation, and scripted image cleanup, with APT handling the stable package path and source builds covering current upstream needs. For web applications, pair the CLI tools with Install PHP Imagick on Debian; for source workflows, keep Install Git on Debian available for release-tag updates.

Share this guide

Help another Linux user troubleshoot faster

Share this guide with someone troubleshooting Linux systems or saving it for later.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show more of our fresh Linux tutorials in Top Stories and From your sources when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: