How to install OpenSSL and update its PATH in Windows

  John Mwaniki /   07 Jan 2022
How to install OpenSSL and update its PATH in Windows

In this article, you will learn what OpenSSL is, what it is used for, how to download and install it on your Windows PC and add its path to the environment variables in order to use it in your command prompt.

What is OpenSSL?

OpenSSL is a robust open-source software library/toolkit for general-purpose cryptography and secure communication.

OpenSSL allows users to perform various SSL related tasks, such as CSR (Certificate Signing Request), private keys generation, and SSL certificate installation.

It is available for Linux, Windows, macOS, and BSD systems. It comes pre-installed in most Linux distributions. However, if you are on Windows, you will have to install it yourself.

How to install OpenSSL in Windows

Follow the steps below to install OpenSSL on your Windows PC.

Step 1: Download the OpenSSL Installer for Windows. Choose the version that applies to your PC. In my case, I will download Win64 OpenSSL v3.0.1 (Light version).

Downloading OpenSSL for Windows

Step 2: Run the just downloaded OpenSSL installer from your download folder or from whichever directory you select during the download by double-clicking on it.

Running the OpenSSL installer Step 3: Accept the license agreement then hit the "Next" button to proceed. Accept the licence agreement

Step 4: Click on the "Next" button. You can also choose a difference installation directory at this point. I recommend you leave that as it is. Not this directory somewhere as you will require it later.

OpenSSL installation directory

Step 5: Click on the "Next" button.

OpenSSL start menu folder

Step 6: Click on the "Next" button.

OpenSSL additional tasks

Step 7: Click on the "Install" button to start the installation process.

Install OpenSSL

Step 8: At this point the installation is complete. There is an option to donate checked by default. Uncheck the box if you don't want to donate then click on the "Finish" button to exit the installer.

FInishing the OpenSSL installation

At this point, you can start using OpenSSL on your PC. However, there is another important step that is not a must but very helpful.

Add the OpenSSL PATH in Windows environment variables

By default, after installation, OpenSSL is only available from the directory where it resides (C:\Program Files\OpenSSL-Win64\bin).

This means that if you try to use OpenSSL from the command line (command prompt) in any other directory than the above, the command will not be recognized and won't work. It will give you something like the below.

OpenSSL not recognized in windows

It is more convenient to run OpenSSL commands from any directory of your choice on your PC. To do that, you have to add its PATH in the Environment Variables.

To do so, follow the following steps:

Step 1: Search for "Environment Variables" by pressing the Windows button and typing the term "Environment Variables". Click on the "Edit the system environment variables".

Opening the environment variables dialog

Step 2: Click on the "Environment Variables" button.

Clicking on the environment variables button

Step 3: In the screen that appears, select the Path and then click on the "Edit" button.

Environment variables path

Step 4: Click on the "browse" button.

Environment variables browse

Step 5: Browse through folders to "This PC > Windows (C:) > Program Files > OpenSSL - Win64 > bin". Make sure "bin" is selected at the box labeled folder at the bottom, then hit the "OK" button.

Selecting OpenSSL bin folder

You should now be able to see the newly added OpenSSL path at the top of the other(s). Now click "OK" on this screen and the subsequent screens.

We are now done and you can start running the OpenSSL commands in the command prompt in any directory of your choice.

Note: If you already had the command prompt open before doing this process, you will need to close and reopen it for this to work.

That's it!

It's my hope you were able to follow along and it has helped you.