🎁 Surprise Discount: Enjoy 90% Off Your Subscription!

⚡️ Nstproxy - 110M+ IPs for Lightning-Fast Scraping & Automation, Starting at $0.1/GB.

  • Pricing
  • Documentation
EN
Contact

© 2025 NST LABS TECH LTD. ALL RIGHTS RESERVED

Products

Anti-Detect Browser
Nstbrowser RPA
Cloudflare Bypass
Web Unblocker

Solutions

Cloud Fingerprint Browser
Multi-Account Management
Web Scraping & Automation
Anti-Detection Bot

Resources

Pricing
Download
RPA Marketplace
Affiliate Program
Partners
Blog
Release Notes

Support

Contact

Documentation

Legal

Terms
Privacy Policy
Cookies Policy

ProductsSolutionsResourcesSupportLegal

ProductsSolutionsResources

SupportLegal

© 2025 NST LABS TECH LTD. ALL RIGHTS RESERVED

Back to Blog
Use Nstbrowser docker for TikTok automatic likes
Headless Browser

How to use Nstbrowser docker for TikTok automatic likes clicking?

This tutorial demonstrates how to use Nstbrowser docker for TikTok automatic "like" clicking
Jan 08, 2025Robin Brown

We've got an incredible 90% Off Subscription Deal just for you! Now, you can enjoy the following unbeatable prices:

  • Professional Plan: Only **29.9/month** (original price 299)
  • Enterprise Plan: Only **59.9/month** (original price 599)

What’s more, you’ll keep enjoying these discounts with auto-renewal! No extra steps needed—your discount will be automatically applied at renewal.

Get Your Special Discount Now!

Prerequisites

Before we start the tutorial, let's first understand what Nstbrowser and Nstbrowser docker are.

Nstbrowser is a powerful fingerprint browser that provides a real browser environment for each user's account. Each browser is isolated from each other, and can achieve cross-platform environment simulation. Based on fingerprint browser technology, it can easily bypass account tracking and detection of various sites.

Nstbrowser docker is a docker image built based on Nstbrowser. Due to limited local resources, we can easily deploy Nstbrowser to cloud services through docker. Based on the cloud synchronization function, we can directly use Nstbrowser in Nstbrowser docker to create a cultivated browser environment.

Next, we will demonstrate how to use Nstbrowser docker to automatically click like TikTok (Note: TikTok has strict account risk control prevention, please try not to use newly created accounts)

Step 1. Build Profile environment

  1. Create a new profile and turn on cloud synchronization and cookie synchronization in the group settings. Configure proxy and fingerprint parameters according to your needs during profile creation:
Build Profile environment
Build Profile environment
  1. Start the profile and log in to the TikTok account you need to use. You can also use the Puppeteer script to log in to the account:
log in to the TikTok account
  1. Close the logged in profile, you can see the uploading status, and Nstbrowser has synchronized your profile data to the cloud.
Close the logged in profile

Step 2. Prepare Nstbrowser Docker environment

  1. Pull Nstbrowser docker image
Bash Copy
docker pull docker.io/nstbrowser/browserless:latest
  1. Run the container
Bash Copy
docker run -d -it \
  -e TOKEN="YOU API KEY" \
  -p 8848:8848 \
  --name nstbrowserless \
  nstbrowser/browserless:latest

Step 3. Build the "Like" clicking script

Here we use puppeteer-core + axios to demonstrate

  1. Install puppeteer-core and axios:
Bash Copy
# pnpm
pnpm i puppeteer-core axios
# yarn
yarn add puppeteer-core axios
# npm
npm i --save puppeteer-core axios
  1. Start Nstbrowser in docker

Before using puppeteer to connect to Nstbrowser, we need to start Nstbrowser first, start the interface: http://localhost:8848/start/{profileId}. You can check the specific interface details and parameters on the official website:

javaScript Copy
const baseUrl = 'localhost:8848'
const profileId = 'YOU_PROFILEID'

async function startBrowser() {
  const config = {
    "name": "tiktok_star",
    "platform": "windows",
    "kernel": "chrome",
    "kernelMilestone": "130",
    // "proxy": "http://127.0.0.1:8000",   // You can use custom proxy
    // "fingerprint": {                    // configure custom fingerprint parameters
    //     "flags": {
    //         "timezone": "BasedOnIp",
    //         "screen": "Custom"
    //     },
    // },
    // "args": {
    //     "--proxy-bypass-list": "*.nstbrowser.io"  // configure custom start parameters
    // }
  };

  return axios.post(`http://${baseUrl}/start/${profileId}`, JSON.stringify((config)), { headers: { 'Content-Type': 'application/json' } })
    .then((response) => {
      if (response.data.code === 200) {
        return true
      }
    })
    .catch((error) => {
      console.error(error);
    });
}
  1. Write the Puppeteer script

We navigate to the TikTok website. And get the input box element and the OK button in the web page through the developer tool (F12):

Write the Puppeteer script
Write the Puppeteer script

Enter the user content you want to view:

JavaScript Copy
const page = await browser.newPage();
await page.goto('https://www.tiktok.com/');

await page.waitForSelector('input[type=search]') 

await page.type('input[type=search]', 'WillSmith', { delay: '100' })
  1. Get the element of the first video and click it:
Get the element of the first video and click it
JavaScript Copy
await page.waitForSelector('div.css-1fxbsrz-DivVideoListScrollBar.e10wilco12 > div > div:nth-child(1) a')

await page.click('div.css-1fxbsrz-DivVideoListScrollBar.e10wilco12 > div > div:nth-child(1) a')
  1. Enter the video playback page

Sometimes, when entering the playback page, the small window mode will be used by default. We need to restore the window:

JavaScript Copy
try {
   await page.waitForSelector('button.e12q9uh55.css-1xiq6b1-Button-ButtonReturn.e1v8cfre0', { timeout: 3000 });
   // close PictureInPicture
   await page.click('button.e12q9uh55.css-1xiq6b1-Button-ButtonReturn.e1v8cfre0')

 } catch (e) {
   console.log("cant find close button")
 }

Wait for the video to play for a while before liking it

Wait for the video to play
JavaScript Copy
// wait for the video to play for a while
await new Promise(resolve => setTimeout(resolve, 10000));

// give a like
await page.click('button.css-1mizk9b-ButtonActionItem.e1hk3hf90')

Then slide the video to the next one and repeat this operation:

JavaScript Copy
const boundingBox = await page.$('body video').then(el => el.boundingBox());

for (let i = 0; i < 3; i++) {

     // wait for the video to play for a while
     await new Promise(resolve => setTimeout(resolve, 10000));

     // give a like
     await page.click('button.css-1mizk9b-ButtonActionItem.e1hk3hf90')

     // move the mouse to the center of the video
     await page.mouse.move(
       boundingBox.x + boundingBox.width / 2,
       boundingBox.y + boundingBox.height / 2
     );

     // scroll the video down
     await page.mouse.wheel({ deltaY: 100 });
}
  1. The complete code is as follows:
JavaScript Copy
import puppeteer from 'puppeteer-core';
import axios from 'axios';

const baseUrl = 'localhost:8848'
const profileId = 'YOU_PROFILEID'

async function startBrowser() {
  const config = {
    "name": "tiktok_star",
    "platform": "windows",
    "kernel": "chrome",
    "kernelMilestone": "130",
    // "proxy": "http://127.0.0.1:8000", 
    // "doProxyChecking": false,
    // "fingerprint": {
    //     "flags": {
    //         "timezone": "BasedOnIp",
    //         "screen": "Custom"
    //     },
    // },
    // "args": {
    //     "--proxy-bypass-list": "*.nstbrowser.io"
    // }
  };

  return axios.post(`http://${baseUrl}/start/${profileId}`, JSON.stringify((config)), { headers: { 'Content-Type': 'application/json' } })
    .then((response) => {
      if (response.data.code === 200) {
        return true
      }
    })
    .catch((error) => {
      console.error(error);
    });
}

async function execPuppeteer() {
  try {

    const browser = await puppeteer.connect({
      browserWSEndpoint: `ws://${baseUrl}/connect/${profileId}`
    });

    const page = await browser.newPage();
    await page.goto('https://www.tiktok.com/');

    await page.waitForSelector('input[type=search]')

    await page.type('input[type=search]', 'WillSmith', { delay: '100' })

    await page.click('button[data-e2e=search-box-button]')

    await page.waitForSelector('div.css-1fxbsrz-DivVideoListScrollBar.e10wilco12 > div > div:nth-child(1) a')
    //   div.css-1fxbsrz-DivVideoListScrollBar.e10wilco12
    await page.click('div.css-1fxbsrz-DivVideoListScrollBar.e10wilco12 > div > div:nth-child(1) a')

    try {
      await page.waitForSelector('button.e12q9uh55.css-1xiq6b1-Button-ButtonReturn.e1v8cfre0', { timeout: 3000 });
      // close PictureInPicture
      await page.click('button.e12q9uh55.css-1xiq6b1-Button-ButtonReturn.e1v8cfre0')

    } catch (e) {
      console.log("cant find close button")
    }

    await page.waitForSelector('button[data-e2e=arrow-right]')

    await page.click('button[data-e2e=arrow-right]')

    // get the video bounding box
    const boundingBox = await page.$('body video').then(el => el.boundingBox());

    for (let i = 0; i < 3; i++) {

      // wait for the video to play for a while
      await new Promise(resolve => setTimeout(resolve, 10000));

      // give a like
      await page.click('button.css-1mizk9b-ButtonActionItem.e1hk3hf90')

      // move the mouse to the center of the video
      await page.mouse.move(
        boundingBox.x + boundingBox.width / 2,
        boundingBox.y + boundingBox.height / 2
      );

      // scroll the video down
      await page.mouse.wheel({ deltaY: 100 });
    }
    
    await browser.close()
  } catch (e) {
    console.error(e)
  }
}

(async () => {
  const ok = await startBrowser()
  if (ok) {
    await execPuppeteer()
  }
})();

It's a Wrap

Nstbrowser's cloud synchronization function can create a profile on any device and synchronize the profile to other devices and docker environments.

Cloud synchronization can retain the content and history of the page you last visited, greatly simplifying the operation cost. And the same profile environment is the same on any device, which can prevent device detection in the site. Cloud synchronization cookies can synchronize user cookie data together, and the login status based on cookies can also be synchronized to the same profile environment.

More
Why Is IP Purity Important? And How to Detect It?
Headless Browser
Why Is IP Purity Important? And How to Detect It?
Learn why IP purity matters for security and automation. Discover methods to detect and maintain pure IPs, plus Nstbrowser solutions.
Oct 15, 2025Robin Brown
How to Hide IP Addresses? 7 Effective Ways for You!
Headless Browser
How to Hide IP Addresses? 7 Effective Ways for You!
Learn 7 effective ways to hide your IP addresses for privacy, security, and unrestricted access. Includes VPNs, Tor, proxies, and Nstbrowser.
Oct 15, 2025Luke Ulyanov
My Google Account Was Hacked: What to Do Next and How to Protect It
Browser FingerprintHeadless BrowserMulti-accounting
My Google Account Was Hacked: What to Do Next and How to Protect It
Google account hacked? Learn immediate recovery steps, how to secure your account, and essential prevention tips. Discover how Nstbrowser can help protect your multiple Google accounts
Oct 14, 2025Carlos Rivera
Understanding NFTs: A Beginner's Guide to Non-Fungible Tokens in 2025
Headless BrowsersolutionBrowser Fingerprint
Understanding NFTs: A Beginner's Guide to Non-Fungible Tokens in 2025
Demystify NFTs with this beginner's guide for 2025. Learn what non-fungible tokens are, how they work, their diverse applications, and how to securely engage with the NFT ecosystem using Nstbrowser
Oct 14, 2025Carlos Rivera
Why Was My Reddit Account Suspended? Understanding Rules and Reinstatement
Headless BrowserMulti-accounting
Why Was My Reddit Account Suspended? Understanding Rules and Reinstatement
Reddit account suspended? Learn the common reasons for bans, how to appeal effectively, and essential prevention tips to keep your account active. Discover how Nstbrowser can help with multi-account management.
Oct 14, 2025Carlos Rivera
Top 10 Anti-Fingerprint Browsers 2025 — Secure Your Digital Identity
Headless BrowserMulti-accounting
Top 10 Anti-Fingerprint Browsers 2025 — Secure Your Digital Identity
Explore the **top 10 anti-fingerprint browsers in 2025**, starting with Nstbrowser. Compare features, privacy protection, and which fits your needs best.
Oct 13, 2025Robin Brown
Catalogue