How to use Puppeteer browser automation in Multilogin 6
Puppeteer is a Node.js library that automates processes using a Chromium-based browser. It works with the Chrome DevTools Protocol, allowing you to build web crawlers and interact with websites while using the Mimic browser with masked fingerprints.
Step 1: define the app listening port
Define ports
Here's how to predefine your default listening port in the app.properties
file:
- Open Multilogin
- Go to “My account”
- Click “Open logs directory” – this will open the folder
/.multiloginapp.com/logs
- Navigate one folder up to
/.multiloginapp.com
- Use any text editor to open
app.properties
- Add a new line to specify the port number:
multiloginapp.port=35000
- Save the changes
Make sure the port number is between 10000 and 49151.
You can also find the app.properties
file in the .multiloginapp.com
folder:
- Windows:
C:\Users\%username%\.multiloginapp.com
- Linux:
/home/%username%/.multiloginapp.com
- macOS:
/Users/%username%/.multiloginapp.com
The folder may be hidden, depending on your OS settings. To display this folder on Mac devices, you can use the following keyboard shortcuts:
-
Cmd + Shift + H
– to display the current user's folder -
Cmd + Shift + .
(period) – to display hidden folders and files

Step 2: set up Puppeteer
Install Node.js and npm
Before you start, make sure Node.js and the npm package manager are installed on your computer. If not installed, download it from Node.js website.
To check your Node.js and npm versions, open a terminal and run: node -v || node -v && npm -v
.
- The latest versions of Node.js already include npm by default.
- You may also use yarn for Node.js packages management.
Create a new npm project
Navigate to your desired project directory and run npm init -y
.
This command will generate a package.json
file. The -y
flag skips the questionnaire and sets up the project with default values.
Install Puppeteer-Core
To install Puppeteer-core, run npm install [email protected] --save
.
Puppeteer-core versions must match Chromium versions. Check Release notes for Mimic updates, and Documentation for compatibility details.
Create your automation script
Now, create a .js
file and add your automation code. Here's a basic example, which you can modify later to match your automation needs!
const puppeteer = require('puppeteer-core');
const http = require('http');
async function startProfile(){
//Replace profileId value with existing browser profile ID.
let profileId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
let mlaPort = 35000;
/*Send GET request to start the browser profile by profileId.
Returns web socket as response which should be passed to puppeteer.connect*/
http.get(`http://127.0.0.1:${mlaPort}/api/v1/profile/start?automation=true&puppeteer=true&profileId=${profileId}`, (resp) => {
let data = '';
let ws = '';
//Receive response data by chunks
resp.on('data', (chunk) => {
data += chunk;
});
/*The whole response data has been received. Handling JSON Parse errors,
verifying if ws is an object and contains the 'value' parameter.*/
resp.on('end', () => {
let ws;
try {
ws = JSON.parse(data);
} catch(err) {
console.log(err);
}
if (typeof ws === 'object' && ws.hasOwnProperty('value')) {
console.log(`Browser websocket endpoint: ${ws.value}`);
run(ws.value);
}
});
}).on("error", (err) => {
console.log(err.message);
});
}
async function run(ws) {
try{
//Connecting Puppeteer with Mimic instance and performing simple automation.
const browser = await puppeteer.connect({browserWSEndpoint: ws, defaultViewport:null});
const page = await browser.newPage();
await page.goto('https://multilogin.com');
await page.screenshot({ path: `/home/${process.env.USER}/Desktop/multiloginScreenshot.png` });
await browser.close();
} catch(err){
console.log(err.message);
}
}
startProfile();
Launch the file
Launch the .js
file through the terminal to start your automation script using nodejs example.js
.