This project facilitates running a Windows Chrome antidetect browser using the Nodriver automation library within a Docker Linux container with Wine. This setup eliminates the need for a Windows virtual machine, making the process easier, faster, and more efficient.
Ensure you have Docker Engine installed. If not, follow the installation guide here. If you want run docker as non-root user do not forget about this
- Place your preferred antidetect Chrome browser in the
chrome/bin
directory. - Ensure
chrome.exe
is located atchrome/bin/chrome.exe
.
Run the following bash script to generate .env
file
./create_dotenv.sh
The .env
contains:
PROFILE_NAME
: The name of the browser profile (--user_data_dir
chrome arg). You can set any name, create profiles as needed, and reuse them. All profiles are stored inchrome/profiles/
. Feel free to add or remove profiles as necessary. If you run./run.sh
with a non-existent profile, a new blank one will be created.SCRIPT_NAME
: The name of the script to run. All scripts are located inchrome/scripts/
. Each script should contain arun()
function as the entry point.- Rest system env variables that accessible in Chrome Nodriver context
Execute the following script to run the container. This script will handle the post-build GUI Wine installation wine-mono
and python
on the first run. Subsequent runs will be ready for use:
./run.sh
This script also does some check ready stuff and setup screen. You can pass any compose up
arg like --force-recreate
.
Below is an example of a Chrome Nodriver script that demonstrates how to create your own scripts:
import os
from time import sleep
async def run(driver):
url = os.getenv("BROWSER_CHECKER_URL")
await driver.get(url)
while True: # keep browser open
sleep(60) # use sync sleep coz more easy to interupt
This script opens an online browser fingerprint checker. The URL is retrieved from .env
. By default, the file contains the following entries, with only one uncommented:
BROWSER_CHECKER_URL=https://abrahamjuliot.github.io/creepjs/
You can manage these environment variables by setting new ones and accessing them using os.getenv
in your automation scripts.
You can use the ./sharedir
directory for file uploads or downloads in your automation scripts. It is accessible at:
/home/wineuser/sharedir
inside the Linux containerZ:\\home\\wineuser\\sharedir
inside the Wine context
You should use your own antidetect Chrome browser. This involves modifying the original Chrome source code to make the browser undetectable. This mean spoof Canvas, WebGL, Audio, WebRTC (etc) detection and set these spoofing params with Wine environ variables in .env
This project built and tested on Debian 12 (bookworm) Docker host. So here are known possible issues below
If chrome run with black window then try restart X window manager with this script
./debug/reset_display.sh
If Wine broken you can resinstall it this way. Do not worry your browser profiles and Nodriver scripts will NOT be deleted.
./debug/clear_wine_prefix.sh
Then just run you profile and script with ./run.sh
to reinstall