Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Install Image Optimization Packages for WordPress on Ubuntu

A practical Ubuntu installation guide for WordPress image optimization: install the right encoders, enable PHP Imagick, verify executable paths, configure your plugin and test JPEG, PNG, WebP and AVIF delivery.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install the command-line image tools with APT, add SVGO through npm, enable Imagick in the same PHP runtime that serves WordPress, and then configure your image-optimization plugin to call those binaries. Start with:

sudo apt update
sudo apt install imagemagick jpegoptim optipng pngquant gifsicle webp libavif-bin
sudo npm install -g svgo

This provides ImageMagick, JPEG, PNG, GIF, WebP, AVIF and SVG tooling on a self-managed Ubuntu server. Installation alone does not make WordPress use every encoder: the active PHP image editor and your optimization plugin still need to be configured and tested.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the installation provides

Each package supplies a different encoder or optimizer. Install only the formats your site accepts, but the complete baseline is useful when a WordPress site receives photographs, transparent graphics, animated GIFs, next-generation formats or SVG assets.

Package or component Primary use Executable to verify
imagemagick General image reading, conversion and manipulation; used with the PHP Imagick extension magick on newer layouts or convert on older ImageMagick 6 layouts
jpegoptim JPEG optimization jpegoptim
optipng Lossless PNG optimization optipng
pngquant PNG quantization when a smaller, potentially lossy PNG is acceptable pngquant
gifsicle GIF optimization gifsicle
webp WebP encoding and decoding utilities cwebp
libavif-bin AVIF command-line encoding and decoding utilities avifenc
SVGO installed with npm SVG optimization svgo
PHP Imagick extension Lets WordPress use ImageMagick through PHP for media processing imagick in the PHP module list
Ghostscript (optional) Allows ImageMagick/Imagick to generate PDF thumbnails Ghostscript executable supplied by your Ubuntu package set

Ubuntu’s package index lists imagemagick for supported releases including Ubuntu 22.04 LTS (Jammy) and Ubuntu 24.04 LTS (Noble). Package names and executable layouts can change between Ubuntu releases, so verify what your installed packages actually provide before hard-coding paths in a plugin or script.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Before you install

Confirm the server and PHP arrangement

  • Use an account that can run sudo.
  • Identify whether WordPress is served by Apache with its PHP module or by Nginx/another web server with PHP-FPM.
  • Note the PHP version used by the web server. The command-line php binary can use a different version or configuration from PHP-FPM.
  • Take a recent backup of the WordPress files and database before changing production packages or media-processing settings.
  • Prefer a staging site for the first conversion test, especially if the site already has thousands of generated thumbnails.

Decide which formats your site will deliver

JPEG is normally the starting point for photographs. PNG is appropriate for lossless graphics and images that need an alpha channel. GIF remains relevant for legacy animation workflows. WebP and AVIF can reduce delivery size when your browser, cache and WordPress delivery policy support them. SVG optimization is a separate workflow and should not be applied blindly to files that contain scripts, external references or interactive behavior.

Install the Ubuntu packages with APT

1. Refresh package metadata

Run an update before installing anything:

sudo apt update

This refreshes APT’s package lists so the resolver can see the packages available for the configured Ubuntu release and repositories.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Install the baseline image toolchain

Install the format-specific utilities and ImageMagick together:

sudo apt install imagemagick jpegoptim optipng pngquant gifsicle webp libavif-bin

APT resolves dependencies and installs the versions available in your configured repositories. The command does not install a WordPress plugin, alter existing media, or automatically change the format that visitors receive.

3. Install SVGO for SVG files

SVGO is installed through npm in the documented Ubuntu/Debian toolchain. Run:

sudo npm install -g svgo

The global npm location must be available to the account or service that runs your optimization job. If a plugin cannot find svgo after installation, check its executable search path rather than reinstalling the package repeatedly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

4. Add the PHP Imagick extension

ImageMagick binaries and the PHP Imagick extension are separate components. WordPress can have ImageMagick installed while PHP still lacks the imagick module. Install the Imagick extension from the Ubuntu repository for the PHP runtime used by your web server. On releases that expose the standard package name, the command is:

sudo apt install php-imagick

Because PHP package names are tied to the release and enabled repositories, confirm the available package with APT if that name is not found. Do not assume that enabling Imagick for command-line PHP enables it for PHP-FPM or Apache; each runtime can load its own configuration.

5. Restart the PHP-serving process

After installing or enabling the extension, restart the PHP-FPM service used by the site, or restart Apache when Apache loads PHP directly. The service unit is version- and configuration-dependent. Restarting the wrong PHP service leaves WordPress running without Imagick even though the package is present.

Log in to WordPress after the restart and inspect the site’s health or media information to confirm that the active image editor reports ImageMagick/Imagick. If the module appears in CLI output but not in WordPress, compare the CLI PHP version with the web server’s PHP-FPM or Apache version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify every executable before configuring WordPress

Run the checks below from the same server account that will execute your optimization job:

command -v magick || command -v convert
command -v jpegoptim optipng pngquant gifsicle cwebp avifenc svgo
magick -version 2>/dev/null || convert -version
jpegoptim --version
optipng -version
cwebp -version
avifenc --version

The first command deliberately checks both ImageMagick names. Newer package generations commonly expose magick; older ImageMagick 6 layouts commonly expose convert. Use the path that actually exists when a plugin asks for an executable.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

command -v prints a path when the program is on the current PATH. A blank result means the program is missing, installed outside that account’s search path, or named differently by the Ubuntu release. Inspect package metadata and installed files before creating a symlink or changing a plugin setting.

Check Imagick in the relevant PHP runtime

Check the PHP module list from the command line:

php -m | grep -i imagick

A result containing imagick confirms the CLI runtime loaded the extension. It does not, by itself, prove that WordPress’s web runtime loaded it. Confirm from WordPress’s own health information or a server-side PHP information page protected from public access, then remove any diagnostic page after checking.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure WordPress to use the installed tools

Choose the active image editor

WordPress’s media system can use a PHP image editor backed by ImageMagick/Imagick when that extension is available. Set the image editor in the optimization plugin or site configuration that actually processes uploads. Installing imagemagick at the operating-system level does not switch WordPress away from another editor automatically.

Enter executable paths only when the plugin requires them

Some plugins discover binaries through PATH; others provide fields for absolute paths. Copy the paths returned by command -v, including the correct ImageMagick executable name. Do not enter magick if the server only provides convert, and do not assume cwebp is available merely because the package is called webp.

Set format-specific policies

  • Use jpegoptim for JPEG photographs and define whether metadata should be preserved or stripped in the plugin’s own settings.
  • Use optipng when lossless PNG output is required; use pngquant only when the site accepts palette quantization and its visual trade-off.
  • Use gifsicle for GIF optimization, taking care with animated files.
  • Use cwebp for WebP generation when your delivery and compatibility policy supports WebP.
  • Use avifenc for AVIF generation only after confirming that your WordPress delivery path, cache and browser policy support AVIF.
  • Use SVGO for SVG assets that are approved for optimization; retain a source copy because aggressive optimization can remove information an interactive SVG needs.

Test uploads instead of assuming installation succeeded

Use a staging site or a controlled media folder and test representative files. The test should verify both processing and delivery:

  1. Upload a camera-style JPEG photograph.
  2. Upload a transparent PNG containing fine edges and text.
  3. Upload a GIF, including an animated GIF if the site accepts animation.
  4. Generate a WebP derivative and confirm that the resulting file opens and is served with the correct MIME type.
  5. If AVIF is enabled, generate an AVIF derivative and test the browser and cache path used by real visitors.
  6. Upload an SVG only if the site’s security policy permits SVG, then compare the optimized file with the original.
  7. Inspect the WordPress attachment and generated sizes. Confirm that the plugin reports the expected backend rather than silently falling back to another editor.
  8. Open the page in a browser and inspect the network requests to verify that the optimized derivative is actually delivered.

These checks are necessary because package installation proves that binaries exist, not that WordPress invokes them. There are no independent benchmark results attached to this installation procedure; use your own representative files and staging environment to establish quality and size targets.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Handle WebP and AVIF quality correctly

ImageMagick’s WebP documentation gives an important rule: a quality value of 100 or greater selects lossless mode unless lossless=false is explicitly set. Therefore, a setting that looks like “maximum quality” can unexpectedly produce lossless WebP files that are much larger than lossy output.

Choose a quality target together with a file-size and visual-quality target. Compare the original and derivative at the display sizes your theme uses, inspect text and transparency, and record the setting in the plugin configuration. Do not compare a lossy JPEG with a lossless WebP and conclude that the encoder is broken; the compression modes are different.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Optional PDF thumbnail support

Install Ghostscript when the site needs ImageMagick/Imagick to generate thumbnails from uploaded PDFs. It is conditional, not a requirement for ordinary JPEG, PNG, GIF, WebP, AVIF or SVG uploads. Treat PDF processing as a separate capability and test it with a non-sensitive document on staging before enabling automatic thumbnail generation.

Troubleshoot the common failure modes

APT says a package cannot be located

Run sudo apt update again and confirm the Ubuntu release and enabled repositories. Package availability can differ between releases. Search APT’s metadata for the package or its executable rather than substituting an unrelated package name. Ubuntu 22.04 LTS and 24.04 LTS both list ImageMagick, but the complete set of format tools can vary with repository configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The plugin says ImageMagick is missing

  • Run command -v magick || command -v convert and use the command that exists.
  • Check that the web-server account can access the executable and the directories leading to it.
  • Confirm the plugin is configured for ImageMagick/Imagick rather than a different editor.
  • Restart the correct PHP-FPM or Apache service after enabling Imagick.
  • Compare the PHP runtime used by WordPress with the one tested using the CLI.

Imagick appears in CLI PHP but not in WordPress

This almost always indicates different PHP runtimes or configuration files. Check the PHP version and loaded configuration for the web server’s process, enable Imagick there, restart that process, and recheck WordPress’s health information. Installing the extension for one PHP version does not enable it for another.

cwebp or avifenc is missing

Verify that webp and libavif-bin are installed, respectively. Then run command -v cwebp avifenc. If the package is installed but the command is not found, inspect the package’s installed file list and the account’s PATH; do not rename a different encoder to satisfy the plugin.

SVGO works in a shell but not in an automated job

A global npm installation can be outside the PATH inherited by PHP, a queue worker or a scheduled task. Run command -v svgo, add the correct binary directory to the service environment, or provide the absolute path in the plugin if it supports one. Re-run the SVG test under the same service account.

Images become larger after optimization

Check whether the workflow changed compression mode, dimensions or metadata policy. In particular, WebP quality 100 or higher invokes lossless mode unless explicitly overridden. Compare like-for-like dimensions and formats, and inspect a visual sample before changing settings globally.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WordPress uploads work but no WebP or AVIF is delivered

Generation and delivery are separate. Confirm that the derivative files were created, that the optimization plugin is configured to select them, and that the cache or rewrite layer serves the derivative with the correct content type. A successful encoder command does not change existing HTML, cached pages or CDN behavior by itself.

Choose a toolchain using the right criteria

When deciding whether to install the complete baseline or a smaller set, compare the workflow on these axes:

Decision axis Questions to answer
Format coverage Does the site need JPEG, PNG, GIF, WebP, AVIF, SVG, or several of them?
Ubuntu availability Are the required packages present in the target release and enabled repositories?
WordPress integration Can the active PHP runtime load Imagick, and can the plugin invoke each executable?
Metadata policy Should EXIF, color profiles or other metadata be retained, normalized or removed?
Quality and size target What visual threshold and byte budget apply to each format, and are you comparing equivalent compression modes?
Execution location Will processing run locally on Ubuntu, in a queue, or through a remote image service?
Maintenance responsibility Who updates APT and npm packages, monitors failures and re-tests after upgrades?

A local toolchain gives you direct control over versions, paths and processing policies, but you must maintain the packages and ensure that every service sees the same configuration. A remote service can reduce server maintenance, but it introduces an external dependency and a separate delivery configuration. Whichever model you choose, keep the format policy and test files documented.

Keep the installation maintainable

  • Record the Ubuntu release, PHP runtime, installed package names and executable paths.
  • Re-run the version checks after Ubuntu or PHP upgrades.
  • Retest one JPEG, PNG, WebP and AVIF file after changing an encoder or plugin.
  • Keep original uploads or a reliable backup so an overly aggressive optimization rule can be reversed.
  • Review plugin logs for fallback behavior; a completed upload does not prove that the preferred encoder ran.
  • Apply package updates through APT and update the global SVGO installation according to your normal change-control process.

Installation checklist

  • sudo apt update completed without repository errors.
  • imagemagick, jpegoptim, optipng, pngquant, gifsicle, webp and libavif-bin installed as needed.
  • SVGO installed with sudo npm install -g svgo when SVG optimization is required.
  • Imagick installed and loaded by the PHP runtime serving WordPress.
  • The correct PHP-FPM or Apache process restarted.
  • magick or convert, plus the format-specific executables, found with command -v.
  • WordPress or its optimization plugin configured to use the discovered paths.
  • Representative JPEG, PNG, GIF, WebP, AVIF and SVG tests completed on staging where applicable.
  • Browser delivery checked after generation, including cache behavior.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.