
The easist way to install the latest stable version of OpenSSL is to use your systems package manage. On a Debian distribution, apt-get can be used to install OpenSSL.
apt-get install openssl
On a Red Hat distribution (CentOS, Fedora, Red Hat), dnf install or yum install can be used to install OpenSSL.
dnf install openssl
Or, you can install OpenSSL from source.
Download the .tar.gz file for the version of OpenSSL that you want to compile (install) from source from https://www.openssl.org/source/. For example, let's say I download openssl-1.1.1u.tar.gz. Place the TAR file on your Linux server. Create a temporary directory.
mkdir /tmp/openssl
Use the tar extract command to extract the TAR file to the directory you just created.
tar -zxpf openssl-1.1.1u.tar.gz --directory /tmp/openssl
Move into the extracted directory.
cd /tmp/openssl/openssl-1.1.1u/
Run the ./config command.
./config
If config was successful, the following should be displayed at the end of the output.
**********************************************************************
*** ***
*** OpenSSL has been successfully configured ***
*** ***
*** If you encounter a problem while building, please open an ***
*** issue on GitHub <https://github.com/openssl/openssl/issues> ***
*** and include the output from the following command: ***
*** ***
*** perl configdata.pm --dump ***
*** ***
*** (If you are new to OpenSSL, you might want to consult the ***
*** 'Troubleshooting' section in the INSTALL file first) ***
*** ***
**********************************************************************
Run make.
make
Run make install.
make install
The which command should return the absolute path to the OpenSSL CLI.
~]$ which openssl
/usr/local/bin/openssl
And the openssl --version command show show the version of OpenSSL you installed.
~]$ /usr/local/bin/openssl version
OpenSSL 1.1.1u 30 May 2023 (Library: OpenSSL 1.1.1g FIPS 21 Apr 2020)
Did you find this article helpful?
If so, consider buying me a coffee over at