Download ChromeDriver Binary and Add to Your PATH
Published: Sep 19, 2018
Updated: Feb 28, 2022
Updated: Feb 28, 2022
Table of Contents
Many projects these days rely on chromedriver. Below are steps for Mac and Windows to download it, add it to your PATH, and verify setup.
You can obviously place the chromedriver binary in any directory you like, I just used Mac ${HOME}/bin and Windows C:\bin for this example.
Sister Links #
This article is basically a more specific version of How to Add a Binary (or Executable, or Program) to Your PATH on macOS, Linux, or Windows.
Mac CLI #
- Get familiar with Mac Environment Variables in Terminal
- Create directory
${HOME}/bin - Download it for Mac and save to
${HOME}/bin - Make it executable with
chmod 755 ${HOME}/bin/chromedriver - Open your shell config file in a text editor
- Add the below line then save the file
export PATH="${HOME}/bin:${PATH}" - Restart your Terminal
- Verify setup with
chromedriver -v
Windows CLI #
- Get familiar with Windows Environment Variables in Command Prompt
- Create directory
C:\bin - Download it for Windows and save to
C:\bin - Open Command Prompt and set the
PATHfor your account withsetx PATH "C:\bin;%PATH%" - Restart Command Prompt
- Verify setup with
chromedriver.exe -v
Windows GUI #
- Create directory
C:\bin - Download it for Windows and save to
C:\bin - Depending on your Windows version
- If you’re using Windows 8 or 10, press the Windows key, then search for and select System (Control Panel)
- If you’re using Windows 7, right click the Computer icon on the desktop and click Properties
- Click Advanced system settings
- Click Environment Variables
- Under System Variables, find the
PATHvariable, select it, and click Edit. If there is noPATHvariable, click New - Add
C:\binto the start of the variable value, followed by a;. For example, if the value wasC:\Windows\System32, change it toC:\bin;C:\Windows\System32 - Click OK
- Restart Command Prompt
- Verify setup with
chromedriver.exe -v