Configuring Puppeteer

  • RAM: 512 MB (recommended for basic tasks)

    • The ideal amount of RAM may vary depending on the specifics of each case.

In the APT line, add the puppeteer package separated by comma and space after the already existing packages, as in the example below.

discloud.config
...
APT=tools, puppeteer
...

To ensure proper functioning of Puppeteer in a container, it is necessary to add the --no-sandbox argument in the puppeteer.launch(); statement, as shown in the following example:

const browser = await puppeteer.launch({
  args: ['--no-sandbox']
});

As whatsapp-web.js uses Puppeteer (for QR code generation and background interactions), it is necessary to add the --no-sandbox argument to the Puppeteer options, as in the following example:

const client = new Client({
	puppeteer: {
		args: ['--no-sandbox'],
	}
});

In case of insufficient RAM memory, the QR code may not appear in the Discloud logs. To solve this, increase the memory of your app as mentioned in the requirements above, so that Puppeteer works as expected.

Last updated