Thumbnails not generated with Kirby CMS on CloudPanel
2025-04-09 23:44:34
#1
I’m hosting multiple Kirby websites using CloudPanel on a Debian 11 server with Apache. Everything runs smoothly except for one critical issue:
Thumbnails are not being generated.
There are no errors in the logs. However, Kirby reports missing media files when I visit pages that should display images.
Here's what I’ve tried so far:
  • Both ImageMagick (v7.1) and GD (2.3) are installed and enabled for PHP 8.1.
  • Permissions are set to 755 for folders and 644 for files.
  • File ownership is siteowner😖iteowner, as per CloudPanel defaults.
  • Thumbnails from the Blurry Placeholder plugin are generated correctly.
  • The /usr/local/bin/convert binary exists and works when executed manually.
  • I’ve tried setting both GD and ImageMagick drivers in config.php, but thumbs still don’t generate.


Have you seen this before?
2025-04-09 23:45:22
#2
Yes, I’ve run into this exact issue when deploying Kirby with CloudPanel. It can be tricky because everything looks fine but thumbs silently fail.
Here’s what I’d recommend:
  1. Test exec() inside Kirby
    Add this to a template to see if exec() actually works:

    CODE_BLOCK_0
  2. Check if your PHP user can run convert
    Even if convert works from your shell, the PHP user (usually siteowner) might not have execution permission. Try running:

    CODE_BLOCK_1
Yazdığımız şeyler bizi temsil eder, Efendilik iyidir.
2025-04-09 23:45:41
#3
I tested exec('whoami') from a Kirby template—it returns siteowner, which is correct. Also, running convert directly as siteowner works just fine.
Still, Kirby doesn’t generate thumbnails even though the Placeholder plugin does. Could it be a driver problem?
2025-04-09 23:46:14
#4
Good job narrowing that down.

Yes, it might be related to how Kirby’s thumb generation is triggered. A few more things to check:
  1. Make sure Kirby is actually calling the thumbs method.
    In your template, I noticed you’re using:

    <img src="<?= $image->placeholderUri() ?>" data-src="<?= $image->url() ?>" />

    This loads the original image, not a generated thumb. Try changing to:

    CODE_BLOCK_1
  2. Thumbs are generated only when the URL is called.
    Make sure the image URL is actually accessed from the browser at least once.
Yazdığımız şeyler bizi temsil eder, Efendilik iyidir.
2025-04-09 23:46:32
#5
You’re right—I was never explicitly calling the thumb() method in my templates. I’ve updated the template to use it directly.
However, I still don’t see the generated thumbnails in the /media folder, even after visiting the image pages.
2025-04-09 23:47:07
#6
If you're calling thumb() but still not seeing results, here’s one last thing that tripped me up:

CloudPanel's Nginx/Apache config may block access to image types


Check if you have this block in your Nginx/Apache config:

location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|svg|webp|...)$ {
add_header Access-Control-Allow-Origin "*";
expires max;
access_log off;
}


It may silently block dynamic image requests like thumbs. Try commenting it out or making sure it doesn’t interfere with Kirby’s /media folder.
Yazdığımız şeyler bizi temsil eder, Efendilik iyidir.
2025-04-09 23:47:24
#7
Boom. That was it.

There was a broad location rule in the Nginx config that unintentionally blocked access to the dynamically generated files. Once I adjusted it, thumbs started working perfectly — both in the Panel and frontend.

Thanks again, Rootali. You saved me hours of frustration.
2025-04-09 23:47:55
#8
Anytime, Nemesis. Glad it’s sorted!
CloudPanel is powerful but needs a bit of tweaking for things like Kirby.
Let me know if you run into anything else!
Yazdığımız şeyler bizi temsil eder, Efendilik iyidir.
Please Login or Register.
Currently 1 people reading this topic. (1 guest(s))
Currently reading 0
Reacted 1
Nemesis