Tutorial: Missing SVG support in the imagick module in Nextcloud AIO

:framed_picture: Tutorial: Missing SVG support in the imagick module in Nextcloud AIO

:magnifying_glass_tilted_left: Problem description

In the Nextcloud AIO admin overview, the following warning may appear:

The PHP module โ€œimagickโ€ in this instance has no SVG support. For better compatibility it is recommended to install it.

This warning means that the PHP imagick extension is present, but cannot process SVG files. This can lead to problems generating previews or displaying SVG images and icons correctly.


:white_check_mark: Solution

This issue still occurs in Nextcloud AIO version 30.0.11, and must be resolved manually by adding the imagemagick system package to the container via the NEXTCLOUD_ADDITIONAL_APKS environment variable.

Despite the assumption that SVG support might be included by default in recent releases, it turns out that the system package imagemagick must be explicitly installed for imagick to handle SVG files properly.


:gear: Working docker-compose.yml example

# version: "3.4"

volumes:
  nextcloud_aio_mastercontainer:
    external: true

services:
  nextcloud:
    image: ghcr.io/nextcloud-releases/all-in-one:latest
    restart: unless-stopped
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/cups/client.conf:/etc/cups/client.conf:ro
    ports:
      - 6789:8080  # Web UI of the mastercontainer
    environment:
      - APACHE_PORT=11000
      - NEXTCLOUD_MEMORY_LIMIT=4096M
      - NEXTCLOUD_ADDITIONAL_APKS=cups imagemagick

:counterclockwise_arrows_button: Apply the changes

After editing the docker-compose.yml file, apply the changes by restarting the containers:

docker compose down
docker compose up -d

Once the container restarts, the warning about missing SVG support in imagick will disappear, and SVG files will be properly processed.


:memo: Notes

  • The imagemagick package enables the necessary binaries inside the container that the imagick PHP extension depends on for SVG support.
  • The cups package is included here only for unrelated printing functionality (e.g. the Print & Share app) and has nothing to do with resolving the SVG issue.
  • There is no need to add ghostscript โ€” installing imagemagick via NEXTCLOUD_ADDITIONAL_APKS is sufficient.
  • This fix has been confirmed to work reliably on Nextcloud AIO version 30.0.11.

Hi, just to mention it:

This is used by default. So if one does not set NEXTCLOUD_ADDITIONAL_APKS in the compose file, it should work out of the box.

1 Like