Share your love
Install Latest OpenSSL on Ubuntu 22.04 From Source: Easy Steps

This guide intends to teach you to Install Latest OpenSSL on Ubuntu 22.04. OpenSSL is an open-source command line tool that is commonly used to generate private keys, create CSRs, install your SSL/TLS certificate, and identify certificate information. Now follow the guide steps below to start your OpenSSL installation on your Ubuntu 22.04.
Table of Contents
How To Install Latest OpenSSL on Ubuntu 22.04?
The default OpenSSL version available on Ubuntu 22.04 is version 3.0.2. This guide wants to teach you to install the latest version of OpenSSL from source on your Ubuntu 22.04.
To complete this guide, you need some requirements first. Let’s see what we need for OpenSSL installation on Ubuntu 22.04.
Requirements for OpenSSL Setup
You must have access to your server as a non-root user with sudo privileges which allows the user to execute a command as the superuser. To do this, you can follow this guide on Initial Server Setup with Ubuntu 22.04.
Now proceed to the following steps to Install Latest OpenSSL on Ubuntu 22.04.
Step 1 – Install Dependencies for OpenSSL
Because we want to Install Latest OpenSSL on Ubuntu 22.04 from the source, you need some dependencies for it.
First, you must run the system update by using the following command:
sudo apt update
Then, use the command below to install the dependencies for OpenSSL 3:
sudo apt install build-essential checkinstall zlib1g-dev -y
Step 2 – Download Latest OpenSSL Binary Package
At this point, you need to visit the GitHub OpenSSL Releases page and get the latest release by using the wget command:
sudo wget https://github.com/openssl/openssl/releases/download/openssl-3.1.2/openssl-3.1.2.tar.gz
Then, extract your downloaded file by using the command below:
sudo tar xvf openssl-3.1.2.tar.gz
Next, navigate to your OpenSSL directory:
cd openssl-3.1*/
Step 3 – Build and Install OpenSSL on Ubuntu 22.04
At this point, from your OpenSSL directory, run the command below to configure your OpenSSL:
sudo ./config
In your output, you should see:
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.md file first) ***
*** ***
**********************************************************************
Next, use the following commands to build and Install Latest OpenSSL on Ubuntu 22.04:
# sudo make
# sudo make test
# sudo make install
These may take some time to complete depending on your system.
When you are done, update links and caches by using the command below:
sudo ldconfig
Then, update your system-wide OpenSSL configuration:
sudo tee /etc/profile.d/openssl.sh<<EOF
export PATH=/usr/local/openssl/bin:\$PATH
export LD_LIBRARY_PATH=/usr/local/openssl/lib:\$LD_LIBRARY_PATH
EOF
Reload shell environment:
source /etc/profile.d/openssl.sh
Step 4 – Verify OpenSSL Installation on Ubuntu 22.04
At this point, you can verify your OpenSSL installation on your server by checking its version:
openssl version -a
In your output, you should see that OpenSSL in the latest version has been installed on Ubuntu 22.04:

Conclusion
The OpenSSL package version available in Ubuntu 22.04 is 3.0.2. In this tutorial, you will learn to Install latest OpenSSL on Ubuntu 22.04 from the source. At the current time, the latest version is 3.1.2. Every time a new version is released, you can use this instruction to install it on your Ubuntu server.
Hope you enjoy it. You may also interested in these articles on the Orcacore website: