Prerequisites
Before installing nodriver, ensure you have:Install with pip
The easiest way to install nodriver is using pip:Update to the latest version
To update nodriver to the latest version:Dependencies
nodriver has minimal dependencies that will be installed automatically:- mss - For screen capture functionality
- websockets (>=14) - For CDP communication
- deprecated - For deprecation warnings
Optional dependencies
For additional features, you may want to install:opencv-python (for Cloudflare verification)
opencv-python (for Cloudflare verification)
Required for the
tab.cf_verify() method to work:Development dependencies
Development dependencies
If you’re contributing to nodriver:This includes: black, build, isort, sphinx, and other development tools.
Installation for headless environments
If you’re running nodriver on a server or in a Docker container without a display, you have two options:- Headless mode
- Virtual display (Xvfb)
Run nodriver in headless mode (no visible browser window):
Docker installation
For Docker environments, here’s a sample Dockerfile:Verify installation
Verify that nodriver is installed correctly:Troubleshooting
Browser not found
Browser not found
If nodriver can’t find your browser, specify the path manually:
Permission errors
Permission errors
On Linux/Mac, you may need to make the browser executable:
Port already in use
Port already in use
If you get a port conflict error, nodriver will usually find another port automatically. If issues persist, you can specify a port:
Websockets connection failed
Websockets connection failed
Ensure you have websockets version 14 or higher:
Next steps
Quickstart guide
Now that you have nodriver installed, learn how to build your first automation script