Unable to get Laravel Spatie/Browsershot working with Puppeteer, Ubuntu 24.04, PHP 8.3, Chrom & Nginx

Environment:

  • PHP 8.3
  • Laravel 11
  • Ubuntu 24.04 LTS
  • NGINX
  • Node (v18.19.1) (latest for today)
  • Spatie/Browsershot (Puppeteer, Chrome 128.0.6613.119)

Issues:

  1. Spatie wanting me to install outdated Node/Puppeteer versions (https://spatie.be/docs/browsershot/v4/requirements). And we all want the latest.
  2. Even if we follow Spatie instructions, we get Permissions errors (www-data user cannot run Chrome or has no permissions to create temp directories).
  3. Other Chrome versions (chromium-browser or non-snap .deb installations) methods do not work (php8.3-fpm does not belong to Snap cgroup or other issues with permissions).
  4. Since we want to use the latest soft versions, some packages are missing.