Run Puppeteer on Ubuntu 24.04 on Digital Ocean droplet


The official dependency list didn’t work for me on Ubuntu 24.04. This not official list didn’t work either. The packages below are the ones that finally got Puppeteer running smoothly on my server.

sudo apt-get update
sudo apt-get install -y \
  ca-certificates \
  fonts-liberation \
  libasound2t64 \
  libasound2-data \
  libatk-bridge2.0-0 \
  libatk1.0-0 \
  libc6 \
  libcairo2 \
  libcups2 \
  libdbus-1-3 \
  libexpat1 \
  libfontconfig1 \
  libgbm1 \
  libgcc1 \
  libglib2.0-0 \
  libgtk-3-0 \
  libnspr4 \
  libnss3 \
  libpango-1.0-0 \
  libpangocairo-1.0-0 \
  libstdc++6 \
  libx11-6 \
  libx11-xcb1 \
  libxcb1 \
  libxcomposite1 \
  libxcursor1 \
  libxdamage1 \
  libxext6 \
  libxfixes3 \
  libxi6 \
  libxrandr2 \
  libxrender1 \
  libxss1 \
  libxtst6 \
  lsb-release \
  wget \
  xdg-utils

Voila! That should solve the problem.

Before installing this dependecies I was getting errors like this:

Error launching browser: Error: Failed to launch the browser process!
/root/.cache/puppeteer/chrome/linux-135.0.7049.84/chrome-linux64/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://pptr.dev/troubleshooting
    at Interface.onClose (/var/www/ricardito/node_modules/.pnpm/@puppeteer+browsers@2.10.0/node_modules/@puppeteer/browsers/lib/cjs/launch.js:325:24)
    at Interface.emit (node:events:530:35)
    at Interface.close (node:internal/readline/interface:530:10)
    at Socket.onend (node:internal/readline/interface:256:10)
    at Socket.emit (node:events:530:35)
    at endReadableNT (node:internal/streams/readable:1698:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Error in scrapeUrlAction: Error: Failed to launch the browser process!
/root/.cache/puppeteer/chrome/linux-135.0.7049.84/chrome-linux64/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory

Leave a Reply

Your email address will not be published. Required fields are marked *