Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ftiersch's avatar

Spatie Browsershot with Docker Container

Hi,

for one of my projects I need to create PDFs and I'd love to try out Spatie's Browsershot package. https://github.com/spatie/browsershot

I haven't worked with Puppeteer yet but I'm working with a Docker setup locally and was wondering if I can integrate that somehow and tell Browsershot to use a Puppeteer container instead of a locally installed version.

Has anyone ever used it that way and can give me any pointers?

Thanks!

0 likes
3 replies
vinnygambiny's avatar

I have found the solution. You have to install chromium in the DockerFile and set the path to this.

Above the run cmd : ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium-browser"

In the run cmd : apt-get install -y chromium-browser

Hope it's can help you

Please or to participate in this conversation.