Table of Contents

How To Install Selenium Chrome On Linux

Last Updated: 2023-09-28

Installing Chrome and Selenium can be quite challenging. This post goes through step by step tutorial to install Selenium and Chrome. I have also put together a small section at the end to cover "most commonly errors" during installation. Lets get started now.

Lets install first Chrome.

How to install Chrome On Centos 7


Lets install chrome now.

yum localinstall google-chrome-stable_current_x86_64.rpm

Lets check if chrome is installed.

google-chrome --version
Google Chrome 79.0.3945.130

I will be using Python Selenium for this post.

How to install Python Selenium

Lets install Selenium first using pip.

pip install selenium
Collecting selenium
  Using cached
Requirement already satisfied: urllib3 in /home/anaconda3/lib/python3.7/site-packages (from selenium) (1.24.2)
Installing collected packages: selenium
Successfully installed selenium-3.141.0

We also need to install package chromedriver. Install it using yum.

yum install chromedriver

Lets try using the Selenium now in Ipython. Import following packages in ipython.

from selenium import webdriver

I am running Chrome as headless on Centos. So we need to add following options before initializing the webdriver.

chromeOptions = webdriver.ChromeOptions()

Lets initialize Chrome webdriver now.

driver = webdriver.Chrome('/usr/bin/chromedriver',chrome_options=chromeOptions)

Commonly encountered errors while intializing Chrome webdriver

Please do following if you encounter any one of the following errors while initializing chrome webdriver.

If you got following error. It means either your chrome installation is not done or not correct. Check it and make sure it is installed correctly.

WebDriverException: Message: unknown error: cannot find Chrome binary

If you get following. Make sure --headless option is added.

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally

To fix following error. Make sure --remote-debugging-port option is added.

unknown error: DevToolsActivePort file doesn't exist

To fix following error, make sure --no-sandbox option is added as shown above.

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
  (chrome not reachable)

If you see following error about chrome version that means your Chromedriver and Chrome versions are out of sync.

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 79 

Go here and find the correct version of ChromeDriver,

unzip the file and move the file to /usr/bin directory...

sudo mv -f chromedriver /usr/bin/chromedriver

How To Install Selenium Chrome On Ubuntu

Install the latest Google Chrome stable version from, As of writing this article - Google Chrome stable version 117 is the latest one.

sudo dpkg -i google-chrome-stable_117.0.5938.132-1_amd64.deb

Install the latest chromedriver

sudo mv chromedriver-linux64/chromedriver /usr/bin/

You can test in Selenium 4.10 and above ...

from selenium import webdriver
from import Service

service = Service(executable_path=r'/usr/bin/chromedriver')
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)

Related Posts