Skip to content

Instantly share code, notes, and snippets.

@brunoalfred
Last active October 25, 2025 12:13
Show Gist options
  • Select an option

  • Save brunoalfred/73f8a0c8dfa431ef0c268e47b70c5854 to your computer and use it in GitHub Desktop.

Select an option

Save brunoalfred/73f8a0c8dfa431ef0c268e47b70c5854 to your computer and use it in GitHub Desktop.

Setup location to install chrome

sudo mkdir -p /var/www/.puppeteer-cache
sudo chown -R www-data:www-data /var/www/.puppeteer-cache

Install chrome using command

PUPPETEER_CACHE_DIR=/var/www/.puppeteer-cache npx puppeteer browsers install chrome

The set the chromepath on browsershot

->setChromePath('/var/www/.puppeteer-cache/chrome/linux-136.0.7103.94/chrome-linux64/chrome')

More tweeks

Configuring Spatie Browsershot with a Custom Chrome Binary.pdf

@lucacastelnuovo
Copy link

Thank you for writing this down. Small note, the attachment link is broken.

@ShaungBhone
Copy link

Thank you so much. That's working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment