How To Install Google Chrome, Selenium & Chromedriver For AWS EC2 Instances

If you’re looking to use selenium and headless browsers on amazon web services (AWS) its essential that you install the relevant versions of selenium, ChromeDriver and Google Chrome to your EC2 instance. In this guide you’ll learn how to easily deploy and test a fully functional selenium python environment.

Install ChromeDriver

You will need to install ChromeDriver which allows you programmatic access to google chrome via the Webdriver API protocol.

Go to Google Chrome for Testing GitHub Downloads page:

Choose your desired Channel. I am choosing the Stable channel.

Copy the URL for chromedriver binary according to your platform. Make sure its HTTP status is 200. I am choosing this URL for my Linux machine:

cd /tmp/
cd chromedriver-linux64
sudo mv chromedriver /usr/bin/chromedriver
chromedriver --version

If you get the fallowing error when running ‘chromedriver –version’ it indicates that the shared library file is missing or cannot be found on your system. is a part of the Network Security Services (NSS) library, which is used by various applications for SSL/TLS support.

To resolve this issue, you can try the following steps based on your operating system:

For Ubuntu/Debian-based systems:

  1. Update your package list: sudo apt-get update
  2. Install the libnss3 package: sudo apt-get install libnss3

For CentOS/RHEL-based systems:

  1. Update your package list: sudo yum update
  2. Install the nss package: sudo yum install nss

Once you’ve installed the required library, try running chromedriver --version again. If the issue persists, you may need to check if there are any other missing dependencies or if there are specific compatibility issues with your system. Additionally, make sure that your system is up-to-date with the latest updates and patches.

Install Chrome on Ubuntu, Debian, and Linux Mint

Open SSH terminal and use the following commands to install Google Chrome on Debian based Linux distributions, such as UbuntuDebianKali, and Linux Mint.

cd /tmp/
sudo apt install ./google-chrome-stable_current_amd64.deb
google-chrome --version

Running a selinum test:


When i try to run the selenium test, I get this error:

The error message “ModuleNotFoundError: No module named ‘selenium'” indicates that Python cannot find the Selenium module in your current environment. To resolve this issue, you need to install the Selenium package.

You can install Selenium using a package manager like pip. Open a terminal or command prompt and run the following command: pip install selenium

Now I get following error:

Then I tried running: python3 -m pip install selenium

and got the following error:

The error “No module named pip” indicates that the pip tool is not installed or not available for your Python installation.

In some systems, the python3 installation may not include pip by default. You can install it separately. Here are some general steps:

For Debian/Ubuntu-based systems:

sudo apt update
sudo apt install python3-pip

After this now you need to install selenium module. Using: pip3 install selenium

Leave a Comment

Your email address will not be published. Required fields are marked *